kspread
KSpread::Token Class Reference
#include <formula.h>
Detailed Description
Token.
Definition at line 37 of file formula.h.
Member Enumeration Documentation
enum KSpread::Token::Op |
operator types
- Enumerator:
enum KSpread::Token::Type |
Constructor & Destructor Documentation
Member Function Documentation
bool Token::asBoolean | ( | ) | const |
Returns boolean value for an boolean token.
For any other type of token, return value is undefined.
Definition at line 236 of file formula.cc.
double Token::asFloat | ( | ) | const |
Returns floating-point value for a floating-point token.
For any other type of token, returns 0.0.
Definition at line 249 of file formula.cc.
int Token::asInteger | ( | ) | const |
Returns integer value for an integer token.
For any other type of token, returns 0.
Definition at line 243 of file formula.cc.
Token::Op Token::asOperator | ( | ) | const |
Returns operator value for an operator token.
For any other type of token, returns Token::InvalidOp.
Definition at line 261 of file formula.cc.
QString Token::asString | ( | ) | const |
Returns string value for a string token.
For any other type of token, it returns QString::null.
Note that token text for a string token still has leading and trailing double-quotes, i.e for "KOffice", text() return "KOffice" (with the quotes, 9 characters) while asString() only return KOffice (without quotes, 7 characters).
Definition at line 255 of file formula.cc.
QString Token::description | ( | ) | const |
Returns a short description of the token.
Should be used only to assist debugging.
Definition at line 278 of file formula.cc.
bool KSpread::Token::isBoolean | ( | ) | const [inline] |
bool KSpread::Token::isCell | ( | ) | const [inline] |
bool KSpread::Token::isFloat | ( | ) | const [inline] |
bool KSpread::Token::isIdentifier | ( | ) | const [inline] |
bool KSpread::Token::isInteger | ( | ) | const [inline] |
bool KSpread::Token::isNumber | ( | ) | const [inline] |
bool KSpread::Token::isOperator | ( | ) | const [inline] |
bool KSpread::Token::isRange | ( | ) | const [inline] |
bool KSpread::Token::isString | ( | ) | const [inline] |
QString Token::sheetName | ( | ) | const |
Returns sheet name in a cell reference token.
For any other type of token, it returns QString::null.
If the cell reference doesn't specify sheet name, an empty string is returned. As example, for "Sheet1!B3" , sheetName() returns "Sheet1" while for "A2" sheetName() returns "".
When sheet name contains quotes (as if the name has spaces) like in "'Sales Forecast'!F4", sheetName() returns the name without the quotes, i.e "Sales Forecast" in this case.
Definition at line 267 of file formula.cc.
QString KSpread::Token::text | ( | ) | const [inline] |
Returns text associated with the token.
If you want to obtain meaningful value of this token, instead of text(), you might use asInteger(), asFloat(), asString(), sheetName(), etc.
Type KSpread::Token::type | ( | ) | const [inline] |
The documentation for this class was generated from the following files: