23 #include <QString> |
23 #include <QString> |
24 #include <QList> |
24 #include <QList> |
25 #include <QVariant> |
25 #include <QVariant> |
26 |
26 |
27 typedef QString str; |
27 typedef QString str; |
28 typedef QChar qchar; |
|
29 typedef QVariant var; |
|
30 template<class T> using list = QList<T>; |
28 template<class T> using list = QList<T>; |
31 typedef unsigned int uint; |
29 typedef unsigned int uint; |
32 typedef unsigned short ushort; |
30 typedef unsigned short ushort; |
33 typedef unsigned long ulong; |
31 typedef unsigned long ulong; |
34 template<class T> using initlist = std::initializer_list<T>; |
32 template<class T> using initlist = std::initializer_list<T>; |
58 class StringFormatArg { |
56 class StringFormatArg { |
59 public: |
57 public: |
60 StringFormatArg (const str& v); |
58 StringFormatArg (const str& v); |
61 StringFormatArg (const char& v); |
59 StringFormatArg (const char& v); |
62 StringFormatArg (const uchar& v); |
60 StringFormatArg (const uchar& v); |
63 StringFormatArg (const qchar& v); |
61 StringFormatArg (const QChar& v); |
64 |
62 |
65 #define NUMERIC_FORMAT_ARG(T,C) \ |
63 #define NUMERIC_FORMAT_ARG(T,C) \ |
66 StringFormatArg (const T& v) { \ |
64 StringFormatArg (const T& v) { \ |
67 char valstr[32]; \ |
65 char valstr[32]; \ |
68 sprintf (valstr, "%" #C, v); \ |
66 sprintf (valstr, "%" #C, v); \ |