/usr/include/dclib-0.3/dclib/core/cbytearray.h is in libdc-dev 0.3.24~svn3121-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | /***************************************************************************
cbytearray.h - description
-------------------
begin : Fri Mar 22 2002
copyright : (C) 2002-2004 by Mathias Küster
email : mathen@users.berlios.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _CBYTEARRAY_H_
#define _CBYTEARRAY_H_
/**
*@author Mathias Küster
*
* It is a byte array, with almost no functions, SetSize() always deletes
* any previous content.
*
* Appending (part of) a byte array to itself never used to work, memcpy()
* does not handle memory areas that overlap, dclib does not
* require this to work, but it should now work.
*/
#include <dclib/dcos.h>
#include <dclib/core/cstring.h>
class CByteArray {
public:
/** */
CByteArray( unsigned long nSize = 0 );
/** */
~CByteArray();
/** */
void SetSize( unsigned long nNewSize );
/**
* Does realloc() i.e. not like SetSize(), this
* can shrink or grow the byte array preserving (some of)
* the contents.
*/
bool Realloc( unsigned long newsize );
/** */
void Append( const unsigned char * pchSrc, unsigned long nSize );
/** */
void Append( const char * pchSrc, unsigned long nSize ) { Append( (const unsigned char*)pchSrc, nSize ); };
/** */
unsigned char * Data();
/** */
unsigned long Size() const;
/** */
bool LoadFromFile( CString file );
/** */
bool SaveToFile( CString file );
private:
/** */
void Clear();
/** */
unsigned char * m_pchBuffer;
/** */
unsigned long m_nSize;
/** */
unsigned long m_nBufferSize;
};
/** */
inline unsigned char * CByteArray::Data()
{ return m_pchBuffer; }
/** */
inline unsigned long CByteArray::Size() const
{ return m_nSize; }
#endif
|