Choreonoid
1.1
|
#include <EasyScanner.h>
クラス | |
class | Endl |
class | Exception |
公開型 | |
enum | TokenType { T_NONE = 0, T_SPACE, T_ALPHABET, T_INTEGER, T_DOUBLE, T_WORD, T_STRING, T_SIGLUM, T_LF, T_EOF } |
typedef std::map< std::string, int > | SymbolMap |
typedef std::pair< std::string, int > | SymbolPair |
typedef boost::shared_ptr< SymbolMap > | SymbolMapPtr |
公開メンバ関数 | |
EasyScanner () | |
EasyScanner (std::string filename) | |
EasyScanner (const EasyScanner &scanner, bool copy_text=false) | |
virtual | ~EasyScanner () |
void | putSymbols () |
void | registerSymbol (int id, const std::string &symbol) |
int | getSymbolID (const std::string &symbol) |
void | setCommentChar (char cc) |
if 0, comment is disabled [詳解] | |
void | setLineOriented (bool on) |
void | setQuoteChar (char qc) |
void | setWhiteSpaceChar (char ws) |
void | loadFile (const std::string &filename) |
void | setText (const char *text, int len) |
void | setLineNumberOffset (int offset) |
void | setDefaultErrorMessage (const std::string &message) |
void | moveToHead () |
int | readToken () |
void | toLower () |
bool | readDouble () |
bool | readInt () |
bool | readChar () |
bool | readChar (int chara) |
int | peekChar () |
bool | readWord () |
bool | readString (const int delimiterChar= ',') |
bool | readString (const char *str) |
bool | readString (const std::string &str) |
bool | readQuotedString (bool allowNoQuotedWord=false) |
bool | readUnquotedTextBlock () |
bool | readSymbol () |
bool | readSymbol (int id) |
bool | isEOF () |
bool | readLF () |
reading a line feed [詳解] | |
bool | readLFEOF () |
bool | checkLF () |
bool | readLine () |
bool | skipLine () |
bool | skipBlankLines () |
void | skipSpace () |
void | throwException (const char *message) |
void | throwException (const std::string &message) |
int | readIntEx (const char *message=0) |
double | readDoubleEx (const char *message=0) |
int | readCharEx (const char *message=0) |
void | readCharEx (int chara, const char *message=0) |
std::string | readWordEx (const char *message=0) |
std::string | readStringEx (const char *message=0) |
std::string | readQuotedStringEx (const char *message=0) |
int | readSymbolEx (const char *message=0) |
void | readLFex (const char *message=0) |
void | readLFEOFex (const char *message=0) |
公開変数類 | |
Endl | endl |
int | intValue |
double | doubleValue |
std::string | stringValue |
char | charValue |
int | symbolValue |
std::string | defaultErrorMessage |
int | lineNumber |
char * | text |
std::string | filename |
フレンド | |
CNOID_EXPORT EasyScanner & | operator>> (EasyScanner &scanner, double &value) |
CNOID_EXPORT EasyScanner & | operator>> (EasyScanner &scanner, int &value) |
CNOID_EXPORT EasyScanner & | operator>> (EasyScanner &scanner, const char *matchString) |
CNOID_EXPORT EasyScanner & | operator>> (EasyScanner &scanner, char matchChar) |
CNOID_EXPORT EasyScanner & | operator>> (EasyScanner &scanner, std::string &str) |
CNOID_EXPORT EasyScanner & | operator>> (EasyScanner &scanner, EasyScanner::Endl endl) |
typedef std::map<std::string, int> cnoid::EasyScanner::SymbolMap |
typedef boost::shared_ptr<SymbolMap> cnoid::EasyScanner::SymbolMapPtr |
typedef std::pair<std::string, int> cnoid::EasyScanner::SymbolPair |
EasyScanner::EasyScanner | ( | ) |
EasyScanner::EasyScanner | ( | std::string | filename | ) |
filename | file to read. |
EasyScanner::EasyScanner | ( | const EasyScanner & | org, |
bool | copyText = false |
||
) |
Copy Constructor. New object inherits another's propety and symbols.
scanner | original object |
copy_text | If true, new object has same text as original |
|
virtual |
bool EasyScanner::checkLF | ( | ) |
|
inline |
|
inline |
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.
void EasyScanner::moveToHead | ( | ) |
int EasyScanner::peekChar | ( | ) |
void EasyScanner::putSymbols | ( | ) |
bool EasyScanner::readChar | ( | ) |
bool EasyScanner::readChar | ( | int | chara | ) |
|
inline |
The exception version of readChar().
|
inline |
The exception version of readChar().
bool EasyScanner::readDouble | ( | ) |
|
inline |
The exception version of readDouble().
bool EasyScanner::readInt | ( | ) |
|
inline |
The exception version of readInt().
|
inline |
reading a line feed
|
inline |
|
inline |
|
inline |
The exception version of readLF().
bool EasyScanner::readLine | ( | ) |
bool EasyScanner::readQuotedString | ( | bool | allowNoQuotedWord = false | ) |
read a quoted string. If 'allowNoQuotedWord' is true, the function read a word without quotations.
|
inline |
|
inline |
In contrast to readWord(), this function allows a string to include siglums such as !,",#,$,%,&,...
bool EasyScanner::readString | ( | const char * | str | ) |
|
inline |
|
inline |
The exception version of readString().
bool EasyScanner::readSymbol | ( | ) |
bool EasyScanner::readSymbol | ( | int | id | ) |
|
inline |
The exception version of readSymbol().
int EasyScanner::readToken | ( | ) |
bool EasyScanner::readUnquotedTextBlock | ( | ) |
|
inline |
In contrast to readString(), this function does not recognize siglums except '_' as a part of a word.
|
inline |
The exception version of readWord().
|
inline |
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. |
|
inline |
void EasyScanner::setLineNumberOffset | ( | int | offset | ) |
void EasyScanner::setLineOriented | ( | bool | on | ) |
void EasyScanner::setQuoteChar | ( | char | qs | ) |
If you want to read quoted string, set quote character by this function. In default, this is unset.
void EasyScanner::setText | ( | const char * | text, |
int | len | ||
) |
This function directly sets a text in the main memory
void EasyScanner::setWhiteSpaceChar | ( | char | ws | ) |
If there is a character to ignore, you can set it by this function
bool EasyScanner::skipBlankLines | ( | ) |
bool EasyScanner::skipLine | ( | ) |
void EasyScanner::skipSpace | ( | ) |
void EasyScanner::throwException | ( | const char * | message | ) |
void EasyScanner::throwException | ( | const std::string & | message | ) |
void EasyScanner::toLower | ( | ) |
This function makes all the characters in stringValue lower case
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
char cnoid::EasyScanner::charValue |
std::string cnoid::EasyScanner::defaultErrorMessage |
double cnoid::EasyScanner::doubleValue |
Endl cnoid::EasyScanner::endl |
std::string cnoid::EasyScanner::filename |
int cnoid::EasyScanner::intValue |
int cnoid::EasyScanner::lineNumber |
std::string cnoid::EasyScanner::stringValue |
int cnoid::EasyScanner::symbolValue |
char* cnoid::EasyScanner::text |