variablebuffer.h
// Copyright (c) 2002 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_VARIABLEBUFFER_H
#define RUDIMENTS_VARIABLEBUFFER_H
#include <rudiments/private/variablebufferincludes.h>
class variablebufferprivate;
class RUDIMENTS_DLLSPEC variablebuffer {
public:
variablebuffer(size_t initialsize, size_t increment);
variablebuffer(unsigned char *initialcontents,
size_t initialsize, size_t increment);
variablebuffer(const variablebuffer &v);
variablebuffer &operator=(const variablebuffer &v);
virtual ~variablebuffer();
void setPosition(size_t pos);
size_t getPosition();
variablebuffer *write(const unsigned char *data, size_t size);
variablebuffer *write(const char *string);
variablebuffer *write(const char *string, size_t size);
variablebuffer *write(char character);
variablebuffer *write(int16_t number);
variablebuffer *write(int32_t number);
variablebuffer *write(int64_t number);
variablebuffer *write(unsigned char character);
variablebuffer *write(uint16_t number);
variablebuffer *write(uint32_t number);
variablebuffer *write(uint64_t number);
variablebuffer *write(float number);
variablebuffer *write(double number);
variablebuffer *writeFormatted(const char *format, ...);
variablebuffer *writeFormatted(const char *format,
va_list *argp);
variablebuffer *append(const unsigned char *data, size_t size);
variablebuffer *append(const char *string);
variablebuffer *append(const char *string, size_t size);
variablebuffer *append(char character);
variablebuffer *append(int16_t number);
variablebuffer *append(int32_t number);
variablebuffer *append(int64_t number);
variablebuffer *append(unsigned char character);
variablebuffer *append(uint16_t number);
variablebuffer *append(uint32_t number);
variablebuffer *append(uint64_t number);
variablebuffer *append(float number);
variablebuffer *append(double number);
variablebuffer *appendFormatted(const char *format, ...);
variablebuffer *appendFormatted(const char *format,
va_list *argp);
virtual void truncate(size_t pos);
virtual void truncate();
ssize_t read(unsigned char *data, size_t size);
void clear();
const unsigned char *getBuffer();
size_t getSize();
size_t getEnd();
size_t getActualSize();
unsigned char *detachBuffer();
#include <rudiments/private/variablebuffer.h>
};
#endif