]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_parsefile.h
9862852bb90411598e2c2db94afb61e1220d8940
[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 <fstream>
9
10 FG_USING_STD(string);
11 FG_USING_STD(list);
12 #if defined ( MACOS ) || defined ( _MSC_VER )
13 FG_USING_STD(ifstream);
14 FG_USING_STD(iostream);
15 FG_USING_STD(endl);
16 #endif
17
18 #define DELIMITERS " \t"
19 #define COMMENT "#"
20
21 #define MAXLINE 200   // Max size of the line of the input file
22
23 typedef list<string> stack; //list to contain the input file "command_lines"
24
25 class ParseFile
26 {
27         private:
28                 
29                 stack commands;
30                 ifstream file;
31                 void readFile();
32
33         public:
34
35                 ParseFile() {}
36                 ParseFile(const string fileName);
37                 ~ParseFile();
38
39                 
40                 void removeComments(string& inputLine);
41                 string getToken(string inputLine, int tokenNo);
42                 void storeCommands(string inputLine);
43                 stack getCommands();
44 };
45
46 #endif  // _PARSE_FILE_H_