diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (patch) | |
tree | 67208f7c145782a7e90b123b982ca78d88cc2c87 /akregator/src/mk4storage/metakit/src/univ.h | |
download | tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.tar.gz tdepim-460c52653ab0dcca6f19a4f492ed2c5e4e963ab0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'akregator/src/mk4storage/metakit/src/univ.h')
-rw-r--r-- | akregator/src/mk4storage/metakit/src/univ.h | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/akregator/src/mk4storage/metakit/src/univ.h b/akregator/src/mk4storage/metakit/src/univ.h new file mode 100644 index 00000000..5558e8a4 --- /dev/null +++ b/akregator/src/mk4storage/metakit/src/univ.h @@ -0,0 +1,115 @@ +// univ.h -- +// $Id$ +// This is part of Metakit, the homepage is http://www.equi4.com/metakit/ + +/** @file + * Definition of the container classes + */ + +#define q4_UNIV 1 + +#include "mk4str.h" + +///////////////////////////////////////////////////////////////////////////// + +class c4_BaseArray +{ +public: + c4_BaseArray (); + ~c4_BaseArray (); + + int GetLength() const; + void SetLength(int nNewSize); + + const void* GetData(int nIndex) const; + void* GetData(int nIndex); + + void Grow(int nIndex); + + void InsertAt(int nIndex, int nCount); + void RemoveAt(int nIndex, int nCount); + +private: + char* _data; + int _size; +// char _buffer[4]; +}; + +class c4_PtrArray +{ +public: + c4_PtrArray (); + ~c4_PtrArray (); + + int GetSize() const; + void SetSize(int nNewSize, int nGrowBy = -1); + + void* GetAt(int nIndex) const; + void SetAt(int nIndex, const void* newElement); + void*& ElementAt(int nIndex); + + int Add(void* newElement); + + void InsertAt(int nIndex, void* newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + +private: + static int Off(int n_); + + c4_BaseArray _vector; +}; + +class c4_DWordArray +{ +public: + c4_DWordArray (); + ~c4_DWordArray (); + + int GetSize() const; + void SetSize(int nNewSize, int nGrowBy = -1); + + t4_i32 GetAt(int nIndex) const; + void SetAt(int nIndex, t4_i32 newElement); + t4_i32& ElementAt(int nIndex); + + int Add(t4_i32 newElement); + + void InsertAt(int nIndex, t4_i32 newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + +private: + static int Off(int n_); + + c4_BaseArray _vector; +}; + +class c4_StringArray +{ +public: + c4_StringArray (); + ~c4_StringArray (); + + int GetSize() const; + void SetSize(int nNewSize, int nGrowBy = -1); + + const char* GetAt(int nIndex) const; + void SetAt(int nIndex, const char* newElement); +// c4_String& ElementAt(int nIndex); + + int Add(const char* newElement); + + void InsertAt(int nIndex, const char* newElement, int nCount = 1); + void RemoveAt(int nIndex, int nCount = 1); + +private: + c4_PtrArray _ptrs; +}; + +///////////////////////////////////////////////////////////////////////////// + +#if q4_INLINE + #include "univ.inl" +#endif + +///////////////////////////////////////////////////////////////////////////// + |