16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +02:00

stl-based names class replacement, re-enabled cab camera shake, enhanced parser comment support, minor bug fixes.

This commit is contained in:
tmj-fstate
2017-02-04 20:23:59 +01:00
parent 567c3a8a39
commit 589b6d5301
11 changed files with 237 additions and 74 deletions

View File

@@ -28,8 +28,7 @@ class cParser //: public std::stringstream
buffer_TEXT
};
// constructors:
cParser(std::string Stream, buffertype Type = buffer_TEXT, std::string Path = "",
bool tr = true);
cParser(std::string const &Stream, buffertype const Type = buffer_TEXT, std::string Path = "", bool const Loadtraction = true );
// destructor:
virtual ~cParser();
// methods:
@@ -79,9 +78,10 @@ class cParser //: public std::stringstream
return !mStream->fail();
};
bool getTokens(int Count = 1, bool ToLower = true, const char *Break = "\n\t ;");
int getProgress() const; // percentage of file processed.
// load traction?
bool LoadTraction;
// returns percentage of file processed so far
int getProgress() const;
// add custom definition of text which should be ignored when retrieving tokens
void addCommentStyle( std::string const &Commentstart, std::string const &Commentend );
private:
// methods:
@@ -92,6 +92,7 @@ class cParser //: public std::stringstream
bool findQuotes( std::string &String );
bool trimComments( std::string &String );
// members:
bool LoadTraction; // load traction?
std::istream *mStream; // relevant kind of buffer is attached on creation.
std::string mPath; // path to open stream, for relative path lookups.
std::streamoff mSize; // size of open stream, for progress report.