summaryrefslogtreecommitdiff
path: root/utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp')
-rwxr-xr-xutils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp b/utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
new file mode 100755
index 0000000000..b47fbb6ff8
--- /dev/null
+++ b/utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
@@ -0,0 +1,41 @@
1/*
2* OutputBuffer.cpp - Part of the PeLib library.
3*
4* Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com)
5* All rights reserved.
6*
7* This software is licensed under the zlib/libpng License.
8* For more details see http://www.opensource.org/licenses/zlib-license.php
9* or the license information file (license.htm) in the root directory
10* of PeLib.
11*/
12
13#include "OutputBuffer.h"
14
15namespace PeLib
16{
17 OutputBuffer::OutputBuffer(std::vector<unsigned char>& vBuffer) : m_vBuffer(vBuffer)
18 {
19 m_vBuffer.clear();
20 }
21
22 const unsigned char* OutputBuffer::data() const
23 {
24 return &m_vBuffer[0];
25 }
26
27 unsigned long OutputBuffer::size()
28 {
29 return static_cast<unsigned long>(m_vBuffer.size());
30 }
31
32 void OutputBuffer::add(const char* lpBuffer, unsigned long ulSize)
33 {
34 std::copy(lpBuffer, lpBuffer + ulSize, std::back_inserter(m_vBuffer));
35 }
36
37 void OutputBuffer::reset()
38 {
39 m_vBuffer.clear();
40 }
41}