#include <EasyScanner.h>
Definition at line 27 of file EasyScanner.h.
typedef std::map<std::string, int> hrp::EasyScanner::SymbolMap |
Definition at line 48 of file EasyScanner.h.
typedef boost::shared_ptr<SymbolMap> hrp::EasyScanner::SymbolMapPtr |
Definition at line 50 of file EasyScanner.h.
typedef std::pair<std::string, int> hrp::EasyScanner::SymbolPair |
Definition at line 49 of file EasyScanner.h.
Definition at line 43 of file EasyScanner.h.
Definition at line 109 of file EasyScanner.cpp.
hrp::EasyScanner::EasyScanner | ( | std::string | filename | ) |
EasyScanner::EasyScanner | ( | const EasyScanner & | org, |
bool | copyText = false |
||
) |
Copy Constructor. New object inherits another's propety and symbols.
org | original object |
copyText | If true, new object has same text as original |
Definition at line 149 of file EasyScanner.cpp.
EasyScanner::~EasyScanner | ( | ) | [virtual] |
Definition at line 192 of file EasyScanner.cpp.
bool EasyScanner::checkLF | ( | ) |
Definition at line 377 of file EasyScanner.cpp.
int EasyScanner::extractQuotedString | ( | ) | [private] |
Definition at line 453 of file EasyScanner.cpp.
int hrp::EasyScanner::getSymbolID | ( | const std::string & | symbol | ) | [inline] |
Definition at line 65 of file EasyScanner.h.
void EasyScanner::init | ( | ) | [private] |
Definition at line 125 of file EasyScanner.cpp.
bool hrp::EasyScanner::isEOF | ( | ) | [inline] |
Definition at line 130 of file EasyScanner.h.
void EasyScanner::loadFile | ( | const std::string & | filename | ) |
This function loads a text from a given file. The function thorws EasyScanner::Exception when the file cannot be loaded.
Definition at line 274 of file EasyScanner.cpp.
Definition at line 204 of file EasyScanner.cpp.
Definition at line 543 of file EasyScanner.cpp.
Definition at line 211 of file EasyScanner.cpp.
bool EasyScanner::readChar | ( | ) |
Definition at line 517 of file EasyScanner.cpp.
bool EasyScanner::readChar | ( | int | chara | ) |
Definition at line 531 of file EasyScanner.cpp.
int hrp::EasyScanner::readCharEx | ( | const char * | message = 0 | ) | [inline] |
The exception version of readChar().
Definition at line 177 of file EasyScanner.h.
void hrp::EasyScanner::readCharEx | ( | int | chara, |
const char * | message = 0 |
||
) | [inline] |
The exception version of readChar().
Definition at line 185 of file EasyScanner.h.
bool EasyScanner::readDouble | ( | ) |
Definition at line 485 of file EasyScanner.cpp.
double hrp::EasyScanner::readDoubleEx | ( | const char * | message = 0 | ) | [inline] |
The exception version of readDouble().
Definition at line 169 of file EasyScanner.h.
bool EasyScanner::readInt | ( | ) |
Definition at line 501 of file EasyScanner.cpp.
int hrp::EasyScanner::readIntEx | ( | const char * | message = 0 | ) | [inline] |
The exception version of readInt().
Definition at line 161 of file EasyScanner.h.
bool hrp::EasyScanner::readLF | ( | ) | [inline] |
reading a line feed
Definition at line 136 of file EasyScanner.h.
bool EasyScanner::readLF0 | ( | ) | [private] |
This function does not call 'skipSpace()'. On the other hand, 'readLF()' calls 'skipSpace()' before calling 'readLF0()'
Definition at line 359 of file EasyScanner.cpp.
bool hrp::EasyScanner::readLFEOF | ( | ) | [inline] |
Definition at line 141 of file EasyScanner.h.
void hrp::EasyScanner::readLFEOFex | ( | const char * | message = 0 | ) | [inline] |
Definition at line 225 of file EasyScanner.h.
void hrp::EasyScanner::readLFex | ( | const char * | message = 0 | ) | [inline] |
The exception version of readLF().
Definition at line 221 of file EasyScanner.h.
bool EasyScanner::readLine | ( | ) |
Definition at line 696 of file EasyScanner.cpp.
bool EasyScanner::readQuotedString | ( | bool | allowNoQuotedWord = false | ) |
read a quoted string. If 'allowNoQuotedWord' is true, the function read a word without quotations.
Definition at line 613 of file EasyScanner.cpp.
std::string hrp::EasyScanner::readQuotedStringEx | ( | const char * | message = 0 | ) | [inline] |
Definition at line 206 of file EasyScanner.h.
bool hrp::EasyScanner::readString | ( | const int | delimiterChar = ',' | ) | [inline] |
In contrast to readWord(), this function allows a string to include siglums such as !,",#,$,%,&,...
Definition at line 112 of file EasyScanner.h.
bool EasyScanner::readString | ( | const char * | str | ) |
Definition at line 593 of file EasyScanner.cpp.
bool hrp::EasyScanner::readString | ( | const std::string & | str | ) | [inline] |
Definition at line 119 of file EasyScanner.h.
bool EasyScanner::readString0 | ( | const int | delimiterChar | ) | [private] |
Definition at line 572 of file EasyScanner.cpp.
std::string hrp::EasyScanner::readStringEx | ( | const char * | message = 0 | ) | [inline] |
The exception version of readString().
Definition at line 201 of file EasyScanner.h.
bool EasyScanner::readSymbol | ( | ) |
Definition at line 649 of file EasyScanner.cpp.
bool EasyScanner::readSymbol | ( | int | id | ) |
Definition at line 662 of file EasyScanner.cpp.
int hrp::EasyScanner::readSymbolEx | ( | const char * | message = 0 | ) | [inline] |
The exception version of readSymbol().
Definition at line 214 of file EasyScanner.h.
Definition at line 388 of file EasyScanner.cpp.
bool EasyScanner::readUnquotedTextBlock | ( | ) |
Definition at line 628 of file EasyScanner.cpp.
bool hrp::EasyScanner::readWord | ( | ) | [inline] |
In contrast to readString(), this function does not recognize siglums except '_' as a part of a word.
Definition at line 103 of file EasyScanner.h.
bool EasyScanner::readWord0 | ( | ) | [private] |
Definition at line 551 of file EasyScanner.cpp.
std::string hrp::EasyScanner::readWordEx | ( | const char * | message = 0 | ) | [inline] |
The exception version of readWord().
Definition at line 192 of file EasyScanner.h.
void hrp::EasyScanner::registerSymbol | ( | int | id, |
const std::string & | symbol | ||
) | [inline] |
Definition at line 61 of file EasyScanner.h.
void EasyScanner::setCommentChar | ( | char | cc | ) |
if 0, comment is disabled
This function sets the identifier character of comment beginning.
cc | Identifier character. Default is '#'. If you want no comment, set 0. |
Definition at line 241 of file EasyScanner.cpp.
void hrp::EasyScanner::setDefaultErrorMessage | ( | const std::string & | message | ) | [inline] |
Definition at line 83 of file EasyScanner.h.
void EasyScanner::setLineNumberOffset | ( | int | offset | ) |
Definition at line 198 of file EasyScanner.cpp.
void EasyScanner::setLineOriented | ( | bool | on | ) |
Definition at line 247 of file EasyScanner.cpp.
void EasyScanner::setQuoteChar | ( | char | qs | ) |
If you want to read quoted string, set quote character by this function. In default, this is unset.
Definition at line 264 of file EasyScanner.cpp.
void EasyScanner::setText | ( | const char * | text, |
int | len | ||
) |
This function directly sets a text in the main memory
Definition at line 177 of file EasyScanner.cpp.
void EasyScanner::setWhiteSpaceChar | ( | char | ws | ) |
If there is a character to ignore, you can set it by this function
Definition at line 254 of file EasyScanner.cpp.
bool EasyScanner::skipBlankLines | ( | ) |
Definition at line 719 of file EasyScanner.cpp.
bool EasyScanner::skipLine | ( | ) |
Definition at line 682 of file EasyScanner.cpp.
Definition at line 319 of file EasyScanner.cpp.
void EasyScanner::skipToLineEnd | ( | ) | [inline, private] |
move the current position to just before the end (LF or EOF) of a line
Definition at line 313 of file EasyScanner.cpp.
void EasyScanner::throwException | ( | const char * | message | ) |
Definition at line 221 of file EasyScanner.cpp.
void EasyScanner::throwException | ( | const std::string & | message | ) |
Definition at line 231 of file EasyScanner.cpp.
This function makes all the characters in stringValue lower case
Definition at line 445 of file EasyScanner.cpp.
HRP_UTIL_EXPORT EasyScanner& operator>> | ( | EasyScanner & | scanner, |
double & | value | ||
) | [friend] |
Definition at line 733 of file EasyScanner.cpp.
HRP_UTIL_EXPORT EasyScanner& operator>> | ( | EasyScanner & | scanner, |
int & | value | ||
) | [friend] |
Definition at line 743 of file EasyScanner.cpp.
HRP_UTIL_EXPORT EasyScanner& operator>> | ( | EasyScanner & | scanner, |
const char * | matchString | ||
) | [friend] |
Definition at line 754 of file EasyScanner.cpp.
HRP_UTIL_EXPORT EasyScanner& operator>> | ( | EasyScanner & | scanner, |
char | matchChar | ||
) | [friend] |
Definition at line 766 of file EasyScanner.cpp.
HRP_UTIL_EXPORT EasyScanner& operator>> | ( | EasyScanner & | scanner, |
std::string & | str | ||
) | [friend] |
HRP_UTIL_EXPORT EasyScanner& operator>> | ( | EasyScanner & | scanner, |
EasyScanner::Endl | endl | ||
) | [friend] |
Definition at line 787 of file EasyScanner.cpp.
Definition at line 232 of file EasyScanner.h.
int hrp::EasyScanner::commentChar [private] |
Definition at line 255 of file EasyScanner.h.
std::string hrp::EasyScanner::defaultErrorMessage |
Definition at line 235 of file EasyScanner.h.
Definition at line 230 of file EasyScanner.h.
Definition at line 52 of file EasyScanner.h.
std::string hrp::EasyScanner::filename |
Definition at line 240 of file EasyScanner.h.
Definition at line 229 of file EasyScanner.h.
bool hrp::EasyScanner::isLineOriented [private] |
Definition at line 257 of file EasyScanner.h.
Definition at line 236 of file EasyScanner.h.
int hrp::EasyScanner::lineNumberOffset [private] |
Definition at line 254 of file EasyScanner.h.
int hrp::EasyScanner::quoteChar [private] |
Definition at line 256 of file EasyScanner.h.
int hrp::EasyScanner::size [private] |
Definition at line 252 of file EasyScanner.h.
std::string hrp::EasyScanner::stringValue |
Definition at line 231 of file EasyScanner.h.
SymbolMapPtr hrp::EasyScanner::symbols [private] |
Definition at line 261 of file EasyScanner.h.
Definition at line 233 of file EasyScanner.h.
char* hrp::EasyScanner::text |
Definition at line 238 of file EasyScanner.h.
char* hrp::EasyScanner::textBuf [private] |
Definition at line 251 of file EasyScanner.h.
char* hrp::EasyScanner::textBufEnd [private] |
Definition at line 253 of file EasyScanner.h.
std::vector<int> hrp::EasyScanner::whiteSpaceChars [private] |
Definition at line 259 of file EasyScanner.h.