#include <valueparser.h>

Public Member Functions

 ValueParser (TDELocale *locale)
 
TDELocale * locale ()
 
void parse (const TQString &str, Cell *cell)
 
Value parse (const TQString &str)
 
Value tryParseBool (const TQString &str, bool *ok=0)
 
Value tryParseNumber (const TQString &str, bool *ok=0)
 
Value tryParseDate (const TQString &str, bool *ok=0)
 
Value tryParseTime (const TQString &str, bool *ok=0)
 

Protected Member Functions

bool tryParseBool (const TQString &str, Cell *cell)
 
bool tryParseNumber (const TQString &str, Cell *cell)
 
bool tryParseDate (const TQString &str, Cell *cell)
 
bool tryParseTime (const TQString &str, Cell *cell)
 
TQDateTime readTime (const TQString &intstr, bool withSeconds, bool *ok, bool &duration)
 
double readNumber (const TQString &_str, bool *ok, bool *isInt)
 
int readInt (const TQString &str, uint &pos)
 

Protected Attributes

TDELocale * parserLocale
 
FormatType fmtType
 

Detailed Description

The ValueParser parses a text input from the user, generating Value in the desired format.

Definition at line 40 of file valueparser.h.

Constructor & Destructor Documentation

◆ ValueParser()

ValueParser::ValueParser ( TDELocale *  locale)

constructor

Definition at line 30 of file valueparser.cpp.

Member Function Documentation

◆ locale()

TDELocale * ValueParser::locale ( )

Definition at line 34 of file valueparser.cpp.

◆ parse() [1/2]

Value ValueParser::parse ( const TQString &  str)

try to parse given text, don't set any cell attributes though

Definition at line 88 of file valueparser.cpp.

◆ parse() [2/2]

void ValueParser::parse ( const TQString &  str,
Cell *  cell 
)

try to parse the text in a given cell and set value accordingly

Definition at line 39 of file valueparser.cpp.

◆ readInt()

int ValueParser::readInt ( const TQString &  str,
uint &  pos 
)
protected

a helper function to read integers

helper function to read integers, used in readTime

Parameters
str
posthe position to start at. It will be updated when we parse it.
Returns
the integer read in the string, or -1 if no string

Definition at line 618 of file valueparser.cpp.

◆ readNumber()

double ValueParser::readNumber ( const TQString &  _str,
bool *  ok,
bool *  isInt 
)
protected

a helper function to read numbers and distinguish integers and FPs

Definition at line 202 of file valueparser.cpp.

◆ readTime()

TQDateTime ValueParser::readTime ( const TQString &  intstr,
bool  withSeconds,
bool *  ok,
bool &  duration 
)
protected

converts a string to a date/time value

Definition at line 477 of file valueparser.cpp.

◆ tryParseBool() [1/2]

Value ValueParser::tryParseBool ( const TQString &  str,
bool *  ok = 0 
)

Definition at line 179 of file valueparser.cpp.

◆ tryParseBool() [2/2]

bool ValueParser::tryParseBool ( const TQString &  str,
Cell *  cell 
)
protected

Definition at line 142 of file valueparser.cpp.

◆ tryParseDate() [1/2]

Value ValueParser::tryParseDate ( const TQString &  str,
bool *  ok = 0 
)

Definition at line 333 of file valueparser.cpp.

◆ tryParseDate() [2/2]

bool ValueParser::tryParseDate ( const TQString &  str,
Cell *  cell 
)
protected

Definition at line 160 of file valueparser.cpp.

◆ tryParseNumber() [1/2]

Value ValueParser::tryParseNumber ( const TQString &  str,
bool *  ok = 0 
)

Definition at line 271 of file valueparser.cpp.

◆ tryParseNumber() [2/2]

bool ValueParser::tryParseNumber ( const TQString &  str,
Cell *  cell 
)
protected

Definition at line 151 of file valueparser.cpp.

◆ tryParseTime() [1/2]

Value ValueParser::tryParseTime ( const TQString &  str,
bool *  ok = 0 
)

Definition at line 418 of file valueparser.cpp.

◆ tryParseTime() [2/2]

bool ValueParser::tryParseTime ( const TQString &  str,
Cell *  cell 
)
protected

Definition at line 169 of file valueparser.cpp.

Member Data Documentation

◆ fmtType

FormatType KSpread::ValueParser::fmtType
protected

Definition at line 76 of file valueparser.h.

◆ parserLocale

TDELocale* KSpread::ValueParser::parserLocale
protected

Definition at line 59 of file valueparser.h.


The documentation for this class was generated from the following files: