1
0
Fork 0
flightgear/src/FDM/UIUCModel/uiuc_parsefile.h

46 lines
1,000 B
C
Raw Normal View History

#ifndef _PARSE_FILE_H_
#define _PARSE_FILE_H_
#include <simgear/compiler.h>
#include <string>
#include <list>
2001-04-13 21:00:07 +00:00
#include STL_FSTREAM
2001-03-23 22:59:18 +00:00
SG_USING_STD(list);
SG_USING_STD(string);
SG_USING_STD(getline);
2001-04-13 21:00:07 +00:00
#if !defined (SG_HAVE_NATIVE_SGI_COMPILERS)
2001-03-23 22:59:18 +00:00
SG_USING_STD(ifstream);
2001-04-13 21:00:07 +00:00
#endif
2000-09-21 22:59:27 +00:00
#define DELIMITERS " \t"
#define COMMENT "#"
#define MAXLINE 200 // Max size of the line of the input file
typedef list<string> stack; //list to contain the input file "command_lines"
class ParseFile
{
private:
stack commands;
ifstream file;
void readFile();
public:
ParseFile() {}
ParseFile(const string fileName);
~ParseFile();
void removeComments(string& inputLine);
string getToken(string inputLine, int tokenNo);
void storeCommands(string inputLine);
stack getCommands();
};
#endif // _PARSE_FILE_H_