mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-12 06:32:34 -05:00
Add zook's ZenUtils to SVN
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18010 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7c84ede378
commit
14c7f45cda
147 changed files with 44667 additions and 0 deletions
41
utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
Executable file
41
utils/zenutils/libraries/pelib-0.9/pelib/buffer/OutputBuffer.cpp
Executable file
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue