]> git.mxchange.org Git - flightgear.git/blob - src/FDM/UIUCModel/uiuc_parsefile.h
Fix for bug 1304 - crash loading XML route
[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 using std::list;
11 using std::string;
12 using std::getline;
13 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_