KVIrc  4.9.2
DeveloperAPIs
KviStringConversion.h
Go to the documentation of this file.
1 #ifndef _KVI_STRINGCONVERSION_H_
2 #define _KVI_STRINGCONVERSION_H_
3 
4 //=============================================================================
5 //
6 // File : KviStringConversion.h
7 // Creation date : Thu Oct 20 2000 13:27:12 CEST by Szymon Stefanek
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include "kvi_settings.h"
29 #include "KviCString.h"
30 #include "KviPixmap.h"
31 #include "KviMessageTypeSettings.h"
32 
33 #include <QRect>
34 #include <QColor>
35 #include <QFont>
36 #include <QStringList>
37 #include <QString>
38 
39 namespace KviStringConversion
40 {
41  extern KVILIB_API void init(const QString & szGlobalDir, const QString & szLocalDir);
42 
43  extern KVILIB_API void encodePath(QString & buffer);
44  extern KVILIB_API void decodePath(QString & buffer);
45 
46  extern KVILIB_API void encodePath(QStringList & buffer);
47  extern KVILIB_API void decodePath(QStringList & buffer);
48 
49  // bool <->
50  extern KVILIB_API void toString(const bool bValue, QString & buffer);
51  extern KVILIB_API bool fromString(const QString & szValue, bool & buffer);
52 
53  // int <-> QString
54  extern KVILIB_API void toString(const int iValue, QString & buffer);
55  extern KVILIB_API bool fromString(const QString & szValue, int & buffer);
56 
57  // uint <-> QString
58  extern KVILIB_API void toString(const unsigned int uValue, QString & buffer);
59  extern KVILIB_API bool fromString(const QString & szValue, unsigned int & buffer);
60 
61  // QRect <-> QString
62  extern KVILIB_API void toString(const QRect & rValue, QString & buffer);
63  extern KVILIB_API bool fromString(const QString & szValue, QRect & buffer);
64 
65  // QString <-> QString (Null conversion)
66  extern KVILIB_API void toString(const QString & szValue, QString & buffer);
67  extern KVILIB_API bool fromString(const QString & szValue, QString & buffer);
68 
69  // KviPixmap <-> QString
70  extern KVILIB_API void toString(const KviPixmap & pValue, QString & buffer);
71  extern KVILIB_API bool fromString(const QString & szValue, KviPixmap & buffer);
72 
73  // QFont <-> QString
74  extern KVILIB_API void toString(const QFont & fValue, QString & buffer);
75  extern KVILIB_API bool fromString(const QString & szValue, QFont & buffer);
76 
77  // KviMessageTypeSettings <-> QString
78  extern KVILIB_API void toString(const KviMessageTypeSettings & mValue, QString & buffer);
79  extern KVILIB_API bool fromString(const QString & szValue, KviMessageTypeSettings & buffer);
80 
81  // QColor <-> QString
82  extern KVILIB_API void toString(const QColor & cValue, QString & buffer);
83  extern KVILIB_API bool fromString(const QString & szValue, QColor & buffer);
84 
85  // QStringList <-> QString
86  extern KVILIB_API void toString(const QStringList & sValue, QString & buffer);
87  extern KVILIB_API bool fromString(const QString & szValue, QStringList & buffer);
88 }
89 
90 #endif
void init(const QString &szGlobalDir, const QString &szLocalDir)
Definition: KviStringConversion.cpp:36
bool fromString(const QString &szValue, bool &bBuffer)
Definition: KviStringConversion.cpp:105
Definition: KviPixmap.h:33
Definition: KviMessageTypeSettings.h:47
void encodePath(QString &szBuffer)
Definition: KviStringConversion.cpp:42
void decodePath(QString &szBuffer)
Definition: KviStringConversion.cpp:65
void toString(const bool bValue, QString &szBuffer)
Definition: KviStringConversion.cpp:100
This file contains compile time settings.
#define KVILIB_API
Definition: kvi_settings.h:125