valueparser.h
00001
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 #include "kspread_value.h"
00028
00029 class KSpreadCell;
00030 class KLocale;
00031
00032 namespace KSpread {
00033
00034
00040 class ValueParser {
00041 public:
00043 ValueParser (KLocale *locale);
00044
00045 KLocale* locale();
00046
00048 void parse (const QString& str, KSpreadCell *cell);
00049
00051 KSpreadValue parse (const QString &str);
00052
00053 KSpreadValue tryParseBool (const QString& str, bool *ok = 0);
00054 KSpreadValue tryParseNumber (const QString& str, bool *ok = 0);
00055 KSpreadValue tryParseDate (const QString& str, bool *ok = 0);
00056 KSpreadValue tryParseTime (const QString& str, bool *ok = 0);
00057 protected:
00058
00059 KLocale* parserLocale;
00060
00061
00062
00063 bool tryParseBool (const QString& str, KSpreadCell *cell);
00064 bool tryParseNumber (const QString& str, KSpreadCell *cell);
00065 bool tryParseDate (const QString& str, KSpreadCell *cell);
00066 bool tryParseTime (const QString& str, KSpreadCell *cell);
00067
00069 QDateTime readTime (const QString & intstr, bool withSeconds, bool *ok,
00070 bool & duration);
00071
00073 int readInt (const QString &str, uint &pos);
00074 FormatType fmtType;
00075 };
00076
00077
00078 }
00079
00080
00081 #endif //KSPREAD_VALUEPARSER
00082
This file is part of the documentation for kspread Library Version 1.4.2.