aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/MyBuffer.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2024-05-14 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2024-05-15 23:55:04 +0500
commitfc662341e6f85da78ada0e443f6116b978f79f22 (patch)
tree1be1cc402a7a9cbc18d4eeea6b141354c2d559e3 /CPP/Common/MyBuffer.h
parent5b39dc76f1bc82f941d5c800ab9f34407a06b53a (diff)
download7zip-24.05.tar.gz
7zip-24.05.tar.bz2
7zip-24.05.zip
24.0524.05
Diffstat (limited to 'CPP/Common/MyBuffer.h')
-rw-r--r--CPP/Common/MyBuffer.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/CPP/Common/MyBuffer.h b/CPP/Common/MyBuffer.h
index bc829f4..80f0205 100644
--- a/CPP/Common/MyBuffer.h
+++ b/CPP/Common/MyBuffer.h
@@ -51,6 +51,12 @@ public:
51 51
52 operator T *() { return _items; } 52 operator T *() { return _items; }
53 operator const T *() const { return _items; } 53 operator const T *() const { return _items; }
54 const T* ConstData() const { return _items; }
55 T* NonConstData() const { return _items; }
56 T* NonConstData() { return _items; }
57 // const T* Data() const { return _items; }
58 // T* Data() { return _items; }
59
54 size_t Size() const { return _size; } 60 size_t Size() const { return _size; }
55 61
56 void Alloc(size_t size) 62 void Alloc(size_t size)
@@ -140,15 +146,15 @@ bool operator!=(const CBuffer<T>& b1, const CBuffer<T>& b2)
140 146
141// typedef CBuffer<char> CCharBuffer; 147// typedef CBuffer<char> CCharBuffer;
142// typedef CBuffer<wchar_t> CWCharBuffer; 148// typedef CBuffer<wchar_t> CWCharBuffer;
143typedef CBuffer<unsigned char> CByteBuffer; 149typedef CBuffer<Byte> CByteBuffer;
144 150
145 151
146class CByteBuffer_Wipe: public CByteBuffer 152class CByteBuffer_Wipe: public CByteBuffer
147{ 153{
148 Z7_CLASS_NO_COPY(CByteBuffer_Wipe) 154 Z7_CLASS_NO_COPY(CByteBuffer_Wipe)
149public: 155public:
150 // CByteBuffer_Wipe(): CBuffer<unsigned char>() {} 156 // CByteBuffer_Wipe(): CBuffer<Byte>() {}
151 CByteBuffer_Wipe(size_t size): CBuffer<unsigned char>(size) {} 157 CByteBuffer_Wipe(size_t size): CBuffer<Byte>(size) {}
152 ~CByteBuffer_Wipe() { Wipe(); } 158 ~CByteBuffer_Wipe() { Wipe(); }
153}; 159};
154 160
@@ -181,6 +187,11 @@ public:
181 187
182 operator T *() { return _items; } 188 operator T *() { return _items; }
183 operator const T *() const { return _items; } 189 operator const T *() const { return _items; }
190 const T* ConstData() const { return _items; }
191 T* NonConstData() const { return _items; }
192 T* NonConstData() { return _items; }
193 // const T* Data() const { return _items; }
194 // T* Data() { return _items; }
184 195
185 void Alloc(size_t newSize) 196 void Alloc(size_t newSize)
186 { 197 {
@@ -191,7 +202,7 @@ public:
191 } 202 }
192}; 203};
193 204
194typedef CObjArray<unsigned char> CByteArr; 205typedef CObjArray<Byte> CByteArr;
195typedef CObjArray<bool> CBoolArr; 206typedef CObjArray<bool> CBoolArr;
196typedef CObjArray<int> CIntArr; 207typedef CObjArray<int> CIntArr;
197typedef CObjArray<unsigned> CUIntArr; 208typedef CObjArray<unsigned> CUIntArr;