Huub Schaeks fix for .schange
[swftools.git] / pdf2swf / xpdf / Lexer.h
index 70144b8..f6ad9ce 100644 (file)
@@ -2,20 +2,24 @@
 //
 // Lexer.h
 //
-// Copyright 1996 Derek B. Noonburg
+// Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
 
 #ifndef LEXER_H
 #define LEXER_H
 
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
 #pragma interface
 #endif
 
 #include "Object.h"
 #include "Stream.h"
 
+class XRef;
+
 #define tokBufSize 128         // size of token buffer
 
 //------------------------------------------------------------------------
@@ -27,11 +31,11 @@ public:
 
   // Construct a lexer for a single stream.  Deletes the stream when
   // lexer is deleted.
-  Lexer(Stream *str);
+  Lexer(XRef *xref, Stream *str);
 
   // Construct a lexer for a stream or array of streams (assumes obj
   // is either a stream or array of streams).
-  Lexer(Object *obj);
+  Lexer(XRef *xref, Object *obj);
 
   // Destructor.
   ~Lexer();
@@ -49,13 +53,17 @@ public:
   Stream *getStream()
     { return curStr.isNone() ? (Stream *)NULL : curStr.getStream(); }
 
-  // Get current position in file.
+  // Get current position in file.  This is only used for error
+  // messages, so it returns an int instead of a Guint.
   int getPos()
-    { return curStr.isNone() ? -1 : curStr.streamGetPos(); }
+    { return curStr.isNone() ? -1 : (int)curStr.streamGetPos(); }
 
   // Set position in file.
-  void setPos(int pos)
-    { if (!curStr.isNone()) curStr.streamSetPos(pos); }
+  void setPos(Guint pos, int dir = 0)
+    { if (!curStr.isNone()) curStr.streamSetPos(pos, dir); }
+
+  // Returns true if <c> is a whitespace character.
+  static GBool isSpace(int c);
 
 private: