MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / Array

Class Array

Libraries/unrar/array.hpp:6–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4extern ErrorHandler ErrHandler;
5
6template <class T> class Array
7{
8 private:
9 T *Buffer;
10 size_t BufSize;
11 size_t AllocSize;
12 size_t MaxSize;
13 bool Secure; // Clean memory if true.
14 public:
15 Array();
16 Array(size_t Size);
17 Array(const Array &Src); // Copy constructor.
18 ~Array();
19 inline void CleanData();
20 inline T& operator [](size_t Item) const;
21 inline T* operator + (size_t Pos);
22 inline size_t Size(); // Returns the size in items, not in bytes.
23 void Add(size_t Items);
24 void Alloc(size_t Items);
25 void Reset();
26 void SoftReset();
27 void operator = (Array<T> &Src);
28 void Push(T Item);
29 void Append(T *Item,size_t Count);
30 T* Addr(size_t Item) {return Buffer+Item;}
31 void SetMaxSize(size_t Size) {MaxSize=Size;}
32 T* Begin() {return Buffer;}
33 T* End() {return Buffer==NULL ? NULL:Buffer+BufSize;}
34 void SetSecure() {Secure=true;}
35};
36
37
38template <class T> void Array<T>::CleanData()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected