KVIrc  4.9.2
DeveloperAPIs
KviKvsVariantList.h
Go to the documentation of this file.
1 #ifndef _KVI_KVS_VARIANTLIST_H_
2 #define _KVI_KVS_VARIANTLIST_H_
3 //=============================================================================
4 //
5 // File : KviKvsVariantList.h
6 // Creation date : Sat 11 Oct 2003 02:20:51 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2003-2010 Szymon Stefanek <pragma at kvirc dot net>
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
33 #include "kvi_settings.h"
34 #include "KviPointerList.h"
35 #include "KviKvsVariant.h"
36 
42 {
43 public:
49 
56 
64 
73 
83 
94 
106 
119 
125  KviKvsVariantList(QString * pS1);
126 
133  KviKvsVariantList(QString * pS1, QString * pS2);
134 
142  KviKvsVariantList(QString * pS1, QString * pS2, QString * pS3);
143 
152  KviKvsVariantList(QString * pS1, QString * pS2, QString * pS3, QString * pS4);
153 
163  KviKvsVariantList(QString * pS1, QString * pS2, QString * pS3, QString * pS4, QString * pS5);
164 
175  KviKvsVariantList(QString * pS1, QString * pS2, QString * pS3, QString * pS4, QString * pS5, QString * pS6);
176 
188  KviKvsVariantList(QString * pS1, QString * pS2, QString * pS3, QString * pS4, QString * pS5, QString * pS6, QString * pS7);
189 
195  KviKvsVariantList(QStringList * pSL);
196 
201 
202 protected:
204 
205 public:
210  KviKvsVariant * first() { return m_pList->first(); };
211 
216  KviKvsVariant * next() { return m_pList->next(); };
217 
223  KviKvsVariant * at(int iIdx) { return m_pList->at(iIdx); };
224 
229  unsigned int count() { return m_pList->count(); };
230 
235  void clear() { m_pList->clear(); };
236 
242  void append(KviKvsVariant * pItem) { m_pList->append(pItem); };
243 
249  void prepend(KviKvsVariant * pItem) { m_pList->prepend(pItem); };
250 
257  void append(const QString & szParam, bool bEscape = false) { m_pList->append(new KviKvsVariant(szParam, bEscape)); };
258 
264  void append(kvs_int_t iInt) { m_pList->append(new KviKvsVariant(iInt)); };
265 
271  void append(kvs_real_t dReal) { m_pList->append(new KviKvsVariant(dReal)); };
272 
278  void append(bool bBoolean) { m_pList->append(new KviKvsVariant(bBoolean)); };
279 
285  void append(kvs_hobject_t hObject) { m_pList->append(new KviKvsVariant(hObject)); };
286 
292  void append(KviKvsArray * pArray) { m_pList->append(new KviKvsVariant(pArray)); };
293 
299  void append(KviKvsHash * pHash) { m_pList->append(new KviKvsVariant(pHash)); };
300 
306  void setAutoDelete(bool bAutoDelete); // this is true by default
307 
313  void allAsString(QString & szBuffer);
314 
320  bool firstAsString(QString & szBuffer);
321 
327  bool nextAsString(QString & szBuffer);
328 };
329 
330 #endif // _KVI_KVS_VARIANTLIST_H_
void append(kvs_hobject_t hObject)
Appends an element to the list.
Definition: KviKvsVariantList.h:285
This class defines a new data type which contains variant data.
Definition: KviKvsVariant.h:351
#define KVIRC_API
Definition: kvi_settings.h:128
KviKvsVariant * at(int iIdx)
Returns the element of the list at the given index.
Definition: KviKvsVariantList.h:223
void append(KviKvsVariant *pItem)
Appends an element to the list.
Definition: KviKvsVariantList.h:242
Class to handle variant variables lists.
Definition: KviKvsVariantList.h:41
KviKvsArray * pArray
Definition: libkviserverdb.cpp:476
void append(KviKvsArray *pArray)
Appends an element to the list.
Definition: KviKvsVariantList.h:292
This class defines a new data type which contains hash data.
Definition: KviKvsHash.h:47
void append(kvs_int_t iInt)
Appends an element to the list.
Definition: KviKvsVariantList.h:264
btnDict setAutoDelete(false)
KviKvsVariant * first()
Returns the first element of the list.
Definition: KviKvsVariantList.h:210
void append(bool bBoolean)
Appends an element to the list.
Definition: KviKvsVariantList.h:278
KviKvsVariant * next()
Returns the next element of the list.
Definition: KviKvsVariantList.h:216
double kvs_real_t
Definition: KviKvsTypes.h:35
C++ Template based double linked pointer list class.
void append(KviKvsHash *pHash)
Appends an element to the list.
Definition: KviKvsVariantList.h:299
void prepend(KviKvsVariant *pItem)
Prepends an element to the list.
Definition: KviKvsVariantList.h:249
void append(kvs_real_t dReal)
Appends an element to the list.
Definition: KviKvsVariantList.h:271
This class defines a new data type which contains array data.
Definition: KviKvsArray.h:43
Handling of variant data type in KVS.
void * kvs_hobject_t
Definition: KviKvsTypes.h:32
char szBuffer[4096]
Definition: winamp.cpp:77
void append(const QString &szParam, bool bEscape=false)
Appends an element to the list.
Definition: KviKvsVariantList.h:257
This file contains compile time settings.
void clear()
Clears the list.
Definition: KviKvsVariantList.h:235
KviPointerList< KviKvsVariant > * m_pList
Definition: KviKvsVariantList.h:203
kvi_i64_t kvs_int_t
Definition: KviKvsTypes.h:33
unsigned int count()
Returns the size of the list.
Definition: KviKvsVariantList.h:229