kspread
valueparser.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KSPREAD_VALUEPARSER
00022 #define KSPREAD_VALUEPARSER
00023
00024 #include <qdatetime.h>
00025
00026 #include "kspread_global.h"
00027
00028 class KLocale;
00029
00030 namespace KSpread
00031 {
00032 class Cell;
00033 class Value;
00034
00040 class ValueParser {
00041 public:
00043 ValueParser (KLocale *locale);
00044
00045 KLocale* locale();
00046
00048 void parse (const QString& str, Cell *cell);
00049
00051 Value parse (const QString &str);
00052
00053 Value tryParseBool (const QString& str, bool *ok = 0);
00054 Value tryParseNumber (const QString& str, bool *ok = 0);
00055 Value tryParseDate (const QString& str, bool *ok = 0);
00056 Value tryParseTime (const QString& str, bool *ok = 0);
00057 protected:
00058
00059 KLocale* parserLocale;
00060
00061
00062
00063 bool tryParseBool (const QString& str, Cell *cell);
00064 bool tryParseNumber (const QString& str, Cell *cell);
00065 bool tryParseDate (const QString& str, Cell *cell);
00066 bool tryParseTime (const QString& str, Cell *cell);
00067
00069 QDateTime readTime (const QString & intstr, bool withSeconds, bool *ok,
00070 bool & duration);
00071
00073 double readNumber(const QString &_str, bool * ok, bool * isInt);
00075 int readInt (const QString &str, uint &pos);
00076 FormatType fmtType;
00077 };
00078
00079
00080 }
00081
00082
00083 #endif //KSPREAD_VALUEPARSER
00084
|