KVIrc 5.2.0
Developer APIs
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{
43public:
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
202protected:
204
205public:
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_
l setAutoDelete(true)
void * kvs_hobject_t
Definition KviKvsTypes.h:32
double kvs_real_t
Definition KviKvsTypes.h:35
kvi_i64_t kvs_int_t
Definition KviKvsTypes.h:33
Handling of variant data type in KVS.
C++ Template based double linked pointer list class.
This class defines a new data type which contains array data.
Definition KviKvsArray.h:44
This class defines a new data type which contains hash data.
Definition KviKvsHash.h:48
Class to handle variant variables lists.
Definition KviKvsVariantList.h:42
void append(kvs_real_t dReal)
Appends an element to the list.
Definition KviKvsVariantList.h:271
KviKvsVariant * first()
Returns the first element of the list.
Definition KviKvsVariantList.h:210
void append(KviKvsArray *pArray)
Appends an element to the list.
Definition KviKvsVariantList.h:292
void append(KviKvsVariant *pItem)
Appends an element to the list.
Definition KviKvsVariantList.h:242
KviKvsVariant * at(int iIdx)
Returns the element of the list at the given index.
Definition KviKvsVariantList.h:223
void append(kvs_hobject_t hObject)
Appends an element to the list.
Definition KviKvsVariantList.h:285
KviPointerList< KviKvsVariant > * m_pList
Definition KviKvsVariantList.h:203
KviKvsVariant * next()
Returns the next element of the list.
Definition KviKvsVariantList.h:216
void append(bool bBoolean)
Appends an element to the list.
Definition KviKvsVariantList.h:278
void append(const QString &szParam, bool bEscape=false)
Appends an element to the list.
Definition KviKvsVariantList.h:257
void prepend(KviKvsVariant *pItem)
Prepends an element to the list.
Definition KviKvsVariantList.h:249
void append(kvs_int_t iInt)
Appends an element to the list.
Definition KviKvsVariantList.h:264
void clear()
Clears the list.
Definition KviKvsVariantList.h:235
unsigned int count()
Returns the size of the list.
Definition KviKvsVariantList.h:229
void append(KviKvsHash *pHash)
Appends an element to the list.
Definition KviKvsVariantList.h:299
This class defines a new data type which contains variant data.
Definition KviKvsVariant.h:352
A template double linked list of pointers.
Definition KviPointerList.h:371
T * at(int idx)
Returns the item at index position.
Definition KviPointerList.h:819
void append(const T *d)
Appends an item at the end of the list.
Definition KviPointerList.h:895
void prepend(KviPointerList< T > *l)
Prepends all the items from the list l to this list.
Definition KviPointerList.h:932
unsigned int count() const
Returns the count of the items in the list.
Definition KviPointerList.h:620
void clear()
Removes all the items from the list.
Definition KviPointerList.h:1105
T * first()
Returns the first item in the list.
Definition KviPointerList.h:632
T * next()
Returns the next item in the list.
Definition KviPointerList.h:781
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127
KviKvsArray * pArray
Definition libkviserverdb.cpp:478
char szBuffer[4096]
Definition winamp.cpp:77