Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

/home/rdbrown/doxygen/cse125g1/src/modules/actor/Token.h

00001 
00002 // token.h
00004 
00005 #ifndef CSE169_TOKEN_H
00006 #define CSE169_TOKEN_H
00007 
00009 
00010 class Tokenizer {
00011 public:
00012         Tokenizer();
00013         ~Tokenizer();
00014 
00015         bool Open(const char *file);
00016         bool Close();
00017 
00018         bool Abort(char *error);        // Prints error & closes file, and always returns false
00019 
00020         // Tokenization
00021         char GetChar();
00022         char CheckChar();
00023         int GetInt();
00024         float GetFloat();
00025         bool GetToken(char *str);
00026         bool FindToken(const char *tok);
00027         bool SkipWhitespace();
00028         bool SkipLine();
00029         bool Reset();
00030 
00031         // Access functions
00032         char *GetFileName()                     {return FileName;}
00033         int GetLineNum()                        {return LineNum;}
00034 
00035 private:
00036         void *File;
00037         char FileName[256];
00038         int LineNum;
00039 };
00040 
00042 
00043 /*
00044 The Tokenizer class for reading simple ascii data files. The GetToken function
00045 just grabs tokens separated by whitespace, but the GetInt and GetFloat functions
00046 specifically parse integers and floating point numbers. SkipLine will skip to
00047 the next carraige return. FindToken searches for a specific token and returns
00048 true if it found it.
00049 */
00050 
00051 #endif

Generated on Thu Aug 18 16:03:09 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18