kspread Library API Documentation

KSpread::ValueParser Class Reference

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

#include <valueparser.h>

List of all members.

Public Member Functions

 ValueParser (KLocale *locale)
KLocale * locale ()
void parse (const QString &str, KSpreadCell *cell)
KSpreadValue parse (const QString &str)
KSpreadValue tryParseBool (const QString &str, bool *ok=0)
KSpreadValue tryParseNumber (const QString &str, bool *ok=0)
KSpreadValue tryParseDate (const QString &str, bool *ok=0)
KSpreadValue tryParseTime (const QString &str, bool *ok=0)

Protected Member Functions

bool tryParseBool (const QString &str, KSpreadCell *cell)
bool tryParseNumber (const QString &str, KSpreadCell *cell)
bool tryParseDate (const QString &str, KSpreadCell *cell)
bool tryParseTime (const QString &str, KSpreadCell *cell)
QDateTime readTime (const QString &intstr, bool withSeconds, bool *ok, bool &duration)
int readInt (const QString &str, uint &pos)

Protected Attributes

KLocale * parserLocale
FormatType fmtType


Detailed Description

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

Definition at line 40 of file valueparser.h.


Constructor & Destructor Documentation

ValueParser::ValueParser KLocale *  locale  ) 
 

constructor

Definition at line 28 of file valueparser.cc.


Member Function Documentation

void ValueParser::parse const QString str,
KSpreadCell cell
 

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

Definition at line 37 of file valueparser.cc.

References KSpreadCell::formatType(), KSpreadValue::setFormat(), and KSpreadCell::setValue().

KSpreadValue ValueParser::parse const QString str  ) 
 

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

Definition at line 83 of file valueparser.cc.

References KSpreadValue::setFormat(), and KSpreadValue::setValue().

QDateTime ValueParser::readTime const QString intstr,
bool  withSeconds,
bool *  ok,
bool &  duration
[protected]
 

converts a string to a date/time value

Definition at line 374 of file valueparser.cc.

References readInt().

int ValueParser::readInt const QString str,
uint &  pos
[protected]
 

a helper function to read integers

Parameters:
str 
pos the 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 515 of file valueparser.cc.

Referenced by readTime().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:51 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003