#include <EasyScanner.h>
Public 型 |
| 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 |
説明
- TODO:
- introduce a pimpl to hide the use of map, vector
型定義
列挙型
- 列挙型の値:
| T_NONE |
|
| T_SPACE |
|
| T_ALPHABET |
|
| T_INTEGER |
|
| T_DOUBLE |
|
| T_WORD |
|
| T_STRING |
|
| T_SIGLUM |
|
| T_LF |
|
| T_EOF |
|
コンストラクタとデストラクタ
| EasyScanner::EasyScanner |
( |
| ) |
|
| EasyScanner::EasyScanner |
( |
std::string |
filename | ) |
|
| 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 |
| EasyScanner::~EasyScanner |
( |
| ) |
|
|
virtual |
関数
| bool EasyScanner::checkLF |
( |
| ) |
|
| int cnoid::EasyScanner::getSymbolID |
( |
const std::string & |
symbol | ) |
|
|
inline |
| bool cnoid::EasyScanner::isEOF |
( |
| ) |
|
|
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 | ) |
|
| int cnoid::EasyScanner::readCharEx |
( |
const char * |
message = 0 | ) |
|
|
inline |
The exception version of readChar().
- 戻り値
- Scanned char value.
| void cnoid::EasyScanner::readCharEx |
( |
int |
chara, |
|
|
const char * |
message = 0 |
|
) |
| |
|
inline |
| bool EasyScanner::readDouble |
( |
| ) |
|
| double cnoid::EasyScanner::readDoubleEx |
( |
const char * |
message = 0 | ) |
|
|
inline |
The exception version of readDouble().
- 戻り値
- Scanned double value.
| bool EasyScanner::readInt |
( |
| ) |
|
| int cnoid::EasyScanner::readIntEx |
( |
const char * |
message = 0 | ) |
|
|
inline |
The exception version of readInt().
- 戻り値
- Scanned int value.
| bool cnoid::EasyScanner::readLF |
( |
| ) |
|
|
inline |
| bool cnoid::EasyScanner::readLFEOF |
( |
| ) |
|
|
inline |
| void cnoid::EasyScanner::readLFEOFex |
( |
const char * |
message = 0 | ) |
|
|
inline |
| void cnoid::EasyScanner::readLFex |
( |
const char * |
message = 0 | ) |
|
|
inline |
| bool EasyScanner::readLine |
( |
| ) |
|
| bool EasyScanner::readQuotedString |
( |
bool |
allowNoQuotedWord = false | ) |
|
read a quoted string. If 'allowNoQuotedWord' is true, the function read a word without quotations.
| std::string cnoid::EasyScanner::readQuotedStringEx |
( |
const char * |
message = 0 | ) |
|
|
inline |
| bool cnoid::EasyScanner::readString |
( |
const int |
delimiterChar = ',' | ) |
|
|
inline |
In contrast to readWord(), this function allows a string to include siglums such as !,",#,$,%,&,...
| bool EasyScanner::readString |
( |
const char * |
str | ) |
|
| bool cnoid::EasyScanner::readString |
( |
const std::string & |
str | ) |
|
|
inline |
| std::string cnoid::EasyScanner::readStringEx |
( |
const char * |
message = 0 | ) |
|
|
inline |
The exception version of readString().
- 戻り値
- Scanned word string.
| bool EasyScanner::readSymbol |
( |
| ) |
|
| bool EasyScanner::readSymbol |
( |
int |
id | ) |
|
| int cnoid::EasyScanner::readSymbolEx |
( |
const char * |
message = 0 | ) |
|
|
inline |
The exception version of readSymbol().
- 戻り値
- ID of the scanned symbol.
| int EasyScanner::readToken |
( |
| ) |
|
| bool EasyScanner::readUnquotedTextBlock |
( |
| ) |
|
| bool cnoid::EasyScanner::readWord |
( |
| ) |
|
|
inline |
In contrast to readString(), this function does not recognize siglums except '_' as a part of a word.
| std::string cnoid::EasyScanner::readWordEx |
( |
const char * |
message = 0 | ) |
|
|
inline |
The exception version of readWord().
- 戻り値
- Scanned word string.
| void cnoid::EasyScanner::registerSymbol |
( |
int |
id, |
|
|
const std::string & |
symbol |
|
) |
| |
|
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. |
| void cnoid::EasyScanner::setDefaultErrorMessage |
( |
const std::string & |
message | ) |
|
|
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
フレンドと関連する関数
変数
| 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 |
このクラスの説明は次のファイルから生成されました: