diff --git a/reader.h b/reader.h
index e9b0234b4972c403099584334386b9d7cb137b62..136fb4748cd45f9e0f5595f13e02f1e72b708339 100644 (file)
--- a/reader.h
+++ b/reader.h
*/
class Reader {
private:
*/
class Reader {
private:
+ static const unsigned int TYPENOTFOUND = 1;
+ static const unsigned int ALIENVERSION = 2;
+
/*
* rider-: Files.Reader
* The file rider which links a Reader to a file.
/*
* rider-: Files.Reader
* The file rider which links a Reader to a file.
/*
* cancelled-: BOOLEAN valid during a Store.Internalize call
/*
* cancelled-: BOOLEAN valid during a Store.Internalize call
- * Tells whether the currently executing Internalize has been called by ReadVersion or TurnIntoAlien.
+ * Tells whether the currently executing Internalize has been cancelled by ReadVersion or TurnIntoAlien.
*/
bool d_cancelled;
*/
bool d_cancelled;
*/
bool d_readAlien;
*/
bool d_readAlien;
+ /**
+ * Cause of current read being alien.
+ */
+ unsigned int d_cause;
+
std::vector<TypeEntry*> d_typeList;
std::vector<Store*> d_elemList; // FIXME: WTH, why are these different?
std::vector<TypeEntry*> d_typeList;
std::vector<Store*> d_elemList; // FIXME: WTH, why are these different?
};
ReaderState *d_state;
};
ReaderState *d_state;
- INTEGER d_cause;
-
public:
/**
* Construct a reader from the istream rider.
public:
/**
* Construct a reader from the istream rider.
* Reads a short character (00X..0FFX).
*/
SHORTCHAR readSChar();
* Reads a short character (00X..0FFX).
*/
SHORTCHAR readSChar();
+ void readSChar(SHORTCHAR *buf, size_t len);
/* PROCEDURE (VAR rd: Reader) ReadXChar (OUT x: CHAR)
* NEW
* Same as ReadSChar, but has a CHAR-type parameter.
* This procedure is provided to simplify migration from Release 1.2 to 1.3.
*/
/* PROCEDURE (VAR rd: Reader) ReadXChar (OUT x: CHAR)
* NEW
* Same as ReadSChar, but has a CHAR-type parameter.
* This procedure is provided to simplify migration from Release 1.2 to 1.3.
*/
- CHAR readXChar();
/**
* PROCEDURE (VAR rd: Reader) ReadChar (OUT x: CHAR)
* NEW
* Reads a character (0000X..0FFFFX).
*/
/**
* PROCEDURE (VAR rd: Reader) ReadChar (OUT x: CHAR)
* NEW
* Reads a character (0000X..0FFFFX).
*/
+ CHAR readLChar();
+ void readLChar(CHAR *buf, size_t len);
/**
* PROCEDURE (VAR rd: Reader) ReadByte (OUT x: BYTE)
* NEW
/**
* PROCEDURE (VAR rd: Reader) ReadByte (OUT x: BYTE)
* NEW
* PROCEDURE (VAR rd: Reader) ReadSInt (OUT x: SHORTINT)
* NEW
* Reads a short integer (-32768..32767).
* PROCEDURE (VAR rd: Reader) ReadSInt (OUT x: SHORTINT)
* NEW
* Reads a short integer (-32768..32767).
- *
+ */
+ SHORTINT readSInt();
+ /**
* PROCEDURE (VAR rd: Reader) ReadXInt (OUT x: INTEGER)
* NEW
* Same as ReadSInt, but has an INTEGER-type parameter.
* PROCEDURE (VAR rd: Reader) ReadXInt (OUT x: INTEGER)
* NEW
* Same as ReadSInt, but has an INTEGER-type parameter.
* Pre
* 20 cause > 0
*/
* Pre
* 20 cause > 0
*/
+ void turnIntoAlien(int cause);
+
+ bool isCancelled();
private:
Store *readStoreOrElemStore(bool isElem);
private:
Store *readStoreOrElemStore(bool isElem);