Go to the documentation of this file.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 KLFDEFS_H_
00025 #define KLFDEFS_H_
00026
00027 #include <qobject.h>
00028
00029
00030 #if defined(QT_VERSION) && QT_VERSION >= 0x040000
00031 # ifndef KLFBACKEND_QT4
00032 # define KLFBACKEND_QT4
00033 # endif
00034 #endif
00035
00036
00037 #include <qstring.h>
00038 #include <qvariant.h>
00039
00040
00041
00042 #ifndef KLF_EXPORT
00043 # if defined(Q_OS_WIN)
00044 # if defined(KLF_SRC_BUILD)
00045 # define KLF_EXPORT __declspec(dllexport)
00046 # else
00047 # define KLF_EXPORT __declspec(dllimport)
00048 # endif
00049 # else
00050 # define KLF_EXPORT __attribute__((visibility("default")))
00051 # endif
00052 #endif
00053
00054
00055
00056
00057 KLF_EXPORT const char * klfVersion();
00058
00059 KLF_EXPORT int klfVersionMaj();
00060 KLF_EXPORT int klfVersionMin();
00061 KLF_EXPORT int klfVersionRelease();
00062
00063
00064 KLF_EXPORT QByteArray klfFmt(const char * fmt, ...)
00065 #if defined(Q_CC_GNU) && !defined(__INSURE__)
00066 __attribute__ ((format (printf, 1, 2)))
00067 #endif
00068 ;
00069
00070 #define klfFmtCC (const char*)klfFmt
00071
00072 KLF_EXPORT QByteArray klfFmt(const char * fmt, va_list pp) ;
00073
00074
00075 #define KLF_FUNC_SINGLE_RUN \
00076 { static bool first_run = true; if ( ! first_run ) return; first_run = false; }
00077
00078
00079
00080
00081
00082
00083 namespace KLFSysInfo
00084 {
00085 enum Os { Linux, Win32, MacOsX, OtherOs };
00086
00087 inline int sizeofVoidStar() { return sizeof(void*); }
00088
00089 KLF_EXPORT QString arch();
00090
00091 KLF_EXPORT KLFSysInfo::Os os();
00092
00093 KLF_EXPORT QString osString(KLFSysInfo::Os sysos = os());
00094 };
00095
00096
00097
00098
00099 KLF_EXPORT int klfVersionCompare(const QString& v1, const QString& v2);
00100
00101 KLF_EXPORT bool klfVersionCompareLessThan(const QString& v1, const QString& v2);
00102
00103
00104 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
00105 # define KLF_PATH_SEP ';'
00106 #else
00107 # define KLF_PATH_SEP ':'
00108 #endif
00109
00110 KLF_EXPORT QStringList klfSearchFind(const QString& wildcard_expression, int limit = -1);
00111 KLF_EXPORT QString klfSearchPath(const QString& prog, const QString& extra_path = "");
00112
00113
00114
00115
00116
00117 #include <klfdebug.h>
00118
00119
00120
00121 #endif