diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/Common/OutBuffer.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/CPP/7zip/Common/OutBuffer.h b/CPP/7zip/Common/OutBuffer.h index cef7d50..88f5787 100644 --- a/CPP/7zip/Common/OutBuffer.h +++ b/CPP/7zip/Common/OutBuffer.h | |||
@@ -60,6 +60,48 @@ public: | |||
60 | WriteByte(((const Byte *)data)[i]); | 60 | WriteByte(((const Byte *)data)[i]); |
61 | } | 61 | } |
62 | 62 | ||
63 | Byte *GetOutBuffer(size_t &avail) | ||
64 | { | ||
65 | const UInt32 pos = _pos; | ||
66 | avail = (size_t)(_limitPos - pos); | ||
67 | return _buf + pos; | ||
68 | } | ||
69 | |||
70 | void SkipWrittenBytes(size_t num) | ||
71 | { | ||
72 | const UInt32 pos = _pos; | ||
73 | const UInt32 rem = _limitPos - pos; | ||
74 | if (rem > num) | ||
75 | { | ||
76 | _pos = pos + (UInt32)num; | ||
77 | return; | ||
78 | } | ||
79 | // (rem <= num) | ||
80 | // the caller must not call it with (rem < num) | ||
81 | // so (rem == num) | ||
82 | _pos = _limitPos; | ||
83 | FlushWithCheck(); | ||
84 | } | ||
85 | /* | ||
86 | void WriteBytesBig(const void *data, size_t size) | ||
87 | { | ||
88 | while (size) | ||
89 | { | ||
90 | UInt32 pos = _pos; | ||
91 | UInt32 rem = _limitPos - pos; | ||
92 | if (rem > size) | ||
93 | { | ||
94 | _pos = pos + size; | ||
95 | memcpy(_buf + pos, data, size); | ||
96 | return; | ||
97 | } | ||
98 | memcpy(_buf + pos, data, rem); | ||
99 | _pos = pos + rem; | ||
100 | FlushWithCheck(); | ||
101 | } | ||
102 | } | ||
103 | */ | ||
104 | |||
63 | UInt64 GetProcessedSize() const throw(); | 105 | UInt64 GetProcessedSize() const throw(); |
64 | }; | 106 | }; |
65 | 107 | ||