KVIrc 5.2.6
Developer APIs
KviKvsArray.h
Go to the documentation of this file.
1#ifndef _KVI_KVS_ARRAY_H_
2#define _KVI_KVS_ARRAY_H_
3//=============================================================================
4//
5// File : KviKvsArray.h
6// Creation date : Tue 07 Oct 2003 01:07:31 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 "KviKvsVariant.h"
35#include "KviHeapObject.h"
36
44{
45public:
51
59 KviKvsArray(const KviKvsArray & array);
60
65
66protected:
70
71public:
77 void unset(kvs_uint_t uIdx);
78
85 void set(kvs_uint_t uIdx, KviKvsVariant * pVal);
86
90 void append(KviKvsVariant * pVal);
91
97 KviKvsVariant * at(kvs_uint_t uIdx) const { return (uIdx < m_uSize) ? m_pData[uIdx] : 0; };
98
107 KviKvsVariant * getAt(kvs_uint_t uIdx);
108
113 bool isEmpty() { return m_uSize == 0; };
114
119 kvs_uint_t size() { return m_uSize; };
120
126 void appendAsString(QString & szBuffer);
127
133 void serialize(QString & szResult);
134
139 void sort();
140
145 void rsort();
146
147protected:
152 void findNewSize();
153
154private:
161 static int compare(const void * pV1, const void * pV2);
162
169 static int compareReverse(const void * pV1, const void * pV2);
170};
171
172#endif // _KVI_KVS_ARRAY_H_
Heap Object.
kvi_u64_t kvs_uint_t
Definition KviKvsTypes.h:34
Handling of variant data type in KVS.
Definition KviHeapObject.h:119
This class defines a new data type which contains array data.
Definition KviKvsArray.h:44
kvs_uint_t size()
Returns the size of the array.
Definition KviKvsArray.h:119
kvs_uint_t m_uAllocSize
Definition KviKvsArray.h:69
bool isEmpty()
Returns true if the array is empty.
Definition KviKvsArray.h:113
kvs_uint_t m_uSize
Definition KviKvsArray.h:68
KviKvsVariant * at(kvs_uint_t uIdx) const
Returns the element at the given index.
Definition KviKvsArray.h:97
KviKvsVariant ** m_pData
Definition KviKvsArray.h:67
This class defines a new data type which contains variant data.
Definition KviKvsVariant.h:352
This file contains compile time settings.
#define KVIRC_API
Definition kvi_settings.h:127
char szBuffer[4096]
Definition winamp.cpp:77