summaryrefslogtreecommitdiff
path: root/utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-07-11 15:50:46 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-07-11 15:50:46 +0000
commit14c7f45cdae826f88dc539c8c38dd95caf305731 (patch)
tree832da054b7cfb2dc6fd63339af736625f31d21aa /utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
parent7c84ede3781c27db73403bd6302f320c76a58c8c (diff)
downloadrockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.zip
rockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.tar.gz
rockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.tar.bz2
rockbox-14c7f45cdae826f88dc539c8c38dd95caf305731.tar.xz
Add zook's ZenUtils to SVN
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18010 a1c6a512-1295-4272-9138-f99709370657
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 0000000..b47fbb6
--- /dev/null
+++ b/utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
@@ -0,0 +1,41 @@
+/*
+* OutputBuffer.cpp - Part of the PeLib library.
+*
+* Copyright (c) 2004 - 2005 Sebastian Porst (webmaster@the-interweb.com)
+* All rights reserved.
+*
+* This software is licensed under the zlib/libpng License.
+* For more details see http://www.opensource.org/licenses/zlib-license.php
+* or the license information file (license.htm) in the root directory
+* of PeLib.
+*/
+
+#include "OutputBuffer.h"
+
+namespace PeLib
+{
+ OutputBuffer::OutputBuffer(std::vector<unsigned char>& vBuffer) : m_vBuffer(vBuffer)
+ {
+ m_vBuffer.clear();
+ }
+
+ const unsigned char* OutputBuffer::data() const
+ {
+ return &m_vBuffer[0];
+ }
+
+ unsigned long OutputBuffer::size()
+ {
+ return static_cast<unsigned long>(m_vBuffer.size());
+ }
+
+ void OutputBuffer::add(const char* lpBuffer, unsigned long ulSize)
+ {
+ std::copy(lpBuffer, lpBuffer + ulSize, std::back_inserter(m_vBuffer));
+ }
+
+ void OutputBuffer::reset()
+ {
+ m_vBuffer.clear();
+ }
+}