Implemented grammer loading

This commit is contained in:
Nathan Braswell
2013-05-20 19:34:15 -04:00
parent 46d59ac595
commit d2698cf203
11 changed files with 342 additions and 4 deletions

26
include/StringReader.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef StringReader_H
#define StringReader_H
#include <vector>
#include <string>
#include <iostream>
class StringReader
{
public:
StringReader();
StringReader(std::string inputString);
virtual ~StringReader();
void setString(std::string inputString);
std::string word(bool truncateEnd = true);
std::string line(bool truncateEnd = true);
std::string getTokens(std::vector<std::string> get_chars, bool truncateEnd = true);
std::string truncateEnd(std::string to_truncate);
protected:
private:
std::string rd_string;
int str_pos;
bool end_reached;
};
#endif