37 void fill (
unsigned char value = 0);
41 bool resize (
size_t newsize);
47 bool assign(
const unsigned char * data,
size_t size);
51 unsigned char*
data ();
53 const unsigned char*
data ()
const;
57 const char*
sdata ()
const;
59 void read(
const char * fname);
61 void write(
const char * fname)
const;
73 unsigned char* mydata;
Buffer & operator=(const Buffer &)
assign a Buffer to another
unsigned char * data()
access to Buffer's data as unsigned char (writable)
void fill(unsigned char value=0)
fill a Buffer with the given value
void write(const char *fname) const
write Buffer to file
void swap(Buffer &x)
swap the content of two Buffer(s)
Namespace used to encapsulate all MPEG-7 CDVA declarations.
Definition: Buffer.h:14
bool operator==(const Buffer &other) const
compare if two Buffer(s) are equal (i.e. if they have the same size and contain the same data) ...
size_t size() const
return the current size of the Buffer
A container class for a byte array, intended to replace all malloc() and new() instructions in the ma...
Definition: Buffer.h:25
void clear()
clear the Buffer
bool empty() const
return true if the Buffer is empty
bool assign(const unsigned char *data, size_t size)
assign the given data to Buffer
void read(const char *fname)
read Buffer from a file
int compare(const Buffer &other) const
Compare this buffer with another; return the number of different bytes.
bool resize(size_t newsize)
change buffer size; content is lost if newsize if less than the current size
bool equals(Buffer &buffer)
compare if two Buffer(s) are equal (i.e. if they have the same size and contain the same data) ...
char * sdata()
access to Buffer's data as signed char (writable)