aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/DynLimBuf.h
diff options
context:
space:
mode:
authorIgor Pavlov <87184205+ip7z@users.noreply.github.com>2021-12-27 00:00:00 +0000
committerIgor Pavlov <87184205+ip7z@users.noreply.github.com>2022-03-18 15:35:13 +0500
commitf19f813537c7aea1c20749c914e756b54a9c3cf5 (patch)
tree816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /CPP/Common/DynLimBuf.h
parent98e06a519b63b81986abe76d28887f6984a7732b (diff)
download7zip-21.07.tar.gz
7zip-21.07.tar.bz2
7zip-21.07.zip
'21.07'21.07
Diffstat (limited to 'CPP/Common/DynLimBuf.h')
-rw-r--r--CPP/Common/DynLimBuf.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/CPP/Common/DynLimBuf.h b/CPP/Common/DynLimBuf.h
new file mode 100644
index 0000000..e80a7e7
--- /dev/null
+++ b/CPP/Common/DynLimBuf.h
@@ -0,0 +1,41 @@
1// Common/DynLimBuf.h
2
3#ifndef __COMMON_DYN_LIM_BUF_H
4#define __COMMON_DYN_LIM_BUF_H
5
6#include <string.h>
7
8#include "../../C/Alloc.h"
9
10#include "MyString.h"
11
12class CDynLimBuf
13{
14 Byte *_chars;
15 size_t _pos;
16 size_t _size;
17 size_t _sizeLimit;
18 bool _error;
19
20 CDynLimBuf(const CDynLimBuf &s);
21
22 // ---------- forbidden functions ----------
23 CDynLimBuf &operator+=(wchar_t c);
24
25public:
26 CDynLimBuf(size_t limit) throw();
27 ~CDynLimBuf() { MyFree(_chars); }
28
29 size_t Len() const { return _pos; }
30 bool IsError() const { return _error; }
31 void Empty() { _pos = 0; _error = false; }
32
33 operator const Byte *() const { return _chars; }
34 // const char *Ptr() const { return _chars; }
35
36 CDynLimBuf &operator+=(char c) throw();
37 CDynLimBuf &operator+=(const char *s) throw();
38};
39
40
41#endif