summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.h
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-10 02:06:42 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-10 02:13:09 -0800
commit5e9e9773f748ab17c8298cd212c77bf5ea1b2051 (patch)
treeb08649df9d56d86f99290ca09c0c3b38f3c40cda /crawl-ref/source/tags.h
parent2ebed5e396b655383be577ec55cfb756fcf328d4 (diff)
downloadcrawl-ref-5e9e9773f748ab17c8298cd212c77bf5ea1b2051.tar.gz
crawl-ref-5e9e9773f748ab17c8298cd212c77bf5ea1b2051.zip
tags: Store minorVersion in reader class
Store the minor version of a savefile being read into the reader class, so that it doesn't need to be passed around as a method/function parameter everywhere.
Diffstat (limited to 'crawl-ref/source/tags.h')
-rw-r--r--crawl-ref/source/tags.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h
index ce2ec65a68..c85796bef9 100644
--- a/crawl-ref/source/tags.h
+++ b/crawl-ref/source/tags.h
@@ -103,18 +103,23 @@ void marshallShowtype (writer &, const show_type &);
class reader
{
public:
- reader(FILE* input)
- : _file(input), _pbuf(0), _read_offset(0) {}
- reader(const std::vector<unsigned char>& input)
- : _file(0), _pbuf(&input), _read_offset(0) {}
+ reader(FILE* input, char minorVersion = TAG_MINOR_VERSION)
+ : _file(input), _pbuf(0), _read_offset(0),
+ _minorVersion(minorVersion) {}
+ reader(const std::vector<unsigned char>& input,
+ char minorVersion = TAG_MINOR_VERSION)
+ : _file(0), _pbuf(&input), _read_offset(0),
+ _minorVersion(minorVersion) {}
unsigned char readByte();
void read(void *data, size_t size);
+ char getMinorVersion();
private:
FILE* _file;
const std::vector<unsigned char>* _pbuf;
unsigned int _read_offset;
+ char _minorVersion;
};
char unmarshallByte (reader &);