00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KLFQT34COMMON_H
00025 #define KLFQT34COMMON_H
00026
00027
00028
00029
00030 #ifdef KLFBACKEND_QT4
00031 #define dir_native_separators(x) QDir::toNativeSeparators(x)
00032 #define ba_assign(otherba) operator=(otherba)
00033 #define dev_WRITEONLY QIODevice::WriteOnly
00034 #define dev_READONLY QIODevice::ReadOnly
00035 #define dev_write write
00036 #define fi_suffix suffix
00037 #define fi_absolutePath absolutePath
00038 #define f_open_fp(fp) open((fp), dev_WRITEONLY)
00039 #define f_setFileName setFileName
00040 #define f_error error
00041 #define s_trimmed trimmed
00042 #define s_toUpper toUpper
00043 #define s_toLatin1 toLatin1
00044 #define s_toLocal8Bit toLocal8Bit
00045 #define s_indexOf indexOf
00046 #define str_split(string, sep, boolAllowEmptyEntries) \
00047 (string).split((sep), (boolAllowEmptyEntries) ? QString::KeepEmptyParts : QString::SkipEmptyParts)
00048 #define list_indexOf(x) indexOf((x))
00049 #define rx_indexin(str) indexIn((str))
00050 #define rx_indexin_i(str, i) indexIn((str), (i))
00051 #define img_settext(key, value) setText((key), (value))
00052 #else
00053 #define qPrintable(x) (x).local8Bit().data()
00054 #define QLatin1String QString::fromLatin1
00055 #define dir_native_separators(x) QDir::convertSeparators(x)
00056 #define ba_assign(otherba) duplicate((otherba).data(), (otherba).size())
00057 #define dev_WRITEONLY IO_WriteOnly
00058 #define dev_READONLY IO_ReadOnly
00059 #define dev_write writeBlock
00060 #define fi_suffix extension
00061 #define fi_absolutePath() dirPath(true)
00062 #define f_open_fp(fp) open(dev_WRITEONLY, (fp))
00063 #define f_setFileName setName
00064 #define f_error errorString
00065 #define s_trimmed stripWhiteSpace
00066 #define s_toUpper upper
00067 #define s_toLatin1 latin1
00068 #define s_toLocal8Bit local8Bit
00069 #define s_indexOf find
00070 #define str_split(string, sep, boolAllowEmptyEntries) \
00071 QStringList::split((sep), (string), (boolAllowEmptyEntries))
00072 #define list_indexOf(x) findIndex((x))
00073 #define rx_indexin(str) search((str))
00074 #define rx_indexin_i(str, i) search((str), (i))
00075 #define img_settext(key, value) setText((key), 0, (value))
00076 #endif
00077
00078
00079
00080
00081 #ifndef KLFBACKEND_QT4
00082
00083
00084
00085
00086
00087
00088
00089
00090 template <int> struct __klf_integer_for_size;
00091 template <> struct __klf_integer_for_size<1> { typedef Q_UINT8 Unsigned; typedef Q_INT8 Signed; };
00092 template <> struct __klf_integer_for_size<2> { typedef Q_UINT16 Unsigned; typedef Q_INT16 Signed; };
00093 template <> struct __klf_integer_for_size<4> { typedef Q_UINT32 Unsigned; typedef Q_INT32 Signed; };
00094 template <> struct __klf_integer_for_size<8> { typedef Q_UINT64 Unsigned; typedef Q_INT64 Signed; };
00095 template <class T> struct __klf_integer_for_sizeof: __klf_integer_for_size<sizeof(T)> { };
00096 typedef __klf_integer_for_sizeof<void*>::Unsigned quintptr;
00097 typedef __klf_integer_for_sizeof<void*>::Signed qptrdiff;
00098 #endif
00099
00100
00101
00102
00103
00104 #endif // KLFQT34COMMON_H