]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_parsefile.h
Sync. w. JSB CVS as of 15/01/2007
[flightgear.git] / src / FDM / UIUCModel / uiuc_parsefile.h
1 #ifndef _PARSE_FILE_H_
2 #define _PARSE_FILE_H_
3
4 #include <simgear/compiler.h>
5
6 #include <string>
7 #include <list>
8 #include STL_FSTREAM
9
10 SG_USING_STD(list);
11 SG_USING_STD(string);
12 SG_USING_STD(getline);
13 SG_USING_STD(ifstream);
14
15 #define DELIMITERS " \t"
16 #define COMMENT "#"
17
18 #define MAXLINE 400   // Max size of the line of the input file
19
20 typedef list<string> stack; //list to contain the input file "command_lines"
21
22 class ParseFile
23 {
24         private:
25                 
26                 stack commands;
27                 ifstream file;
28                 void readFile();
29
30         public:
31
32                 ParseFile() {}
33                 ParseFile(const string fileName);
34                 ~ParseFile();
35
36                 
37                 void removeComments(string& inputLine);
38                 string getToken(string inputLine, int tokenNo);
39                 void storeCommands(string inputLine);
40                 stack getCommands();
41 };
42
43 #endif  // _PARSE_FILE_H_