XmlData API Ref

#include <DbXml.hpp>

class DbXml::XmlData { public: XmlData::XmlData() XmlData::XmlData(const Dbt &dbt) XmlData::XmlData(void *data, size_t size) XmlData::XmlData(const XmlData &o) XmlData &operator = (const XmlData &o) virtual XmlData::~XmlData() ...

void set(const void *data, size_t size); void append(const void *data, size_t size);

void * get_data() const;

size_t get_size() const; void set_size(size_t size);

size_t reserve(size_t size); void getReservedSize() const;

void adoptBuffer(XmlData &src); };


Description: XmlData

The XmlData class encapsulates a buffer for storing and retrieving binary data (uninterpreted bytes). The default and copy constructors for XmlData manage their own memory and the application need not be aware of it. The constructors, XmlData(const Dbt &dbt) and XmlData(void *data, size_t size), create "wrapper" objects for the memory passed in and in those instances it is up to the application to own and manage the memory. If a wrapper object is assigned data that is larger than its memory buffer an exception will be thrown.


Description: void *XmlData::get_data()

Returns the data buffer.


Description: void XmlData::set(void *data, size_t size)

Copies size bytes from data to the start of the underlying buffer, which will expand to fit the data if it is not a wrapper, otherwise an exception will be thrown. This method will change the size of the data.

Parameters
data size

Description: void XmlData::append(void *data, size_t size)

Copies size bytes from data to the end of the existing data in the underlying buffer, which will expand to fit the data if it is not a wrapper, otherwise an exception will be thrown. This method will change the size of the data.

Parameters
data size

Description: size_t XmlData::get_size()

Returns the size of the real data in the buffer.


Description: void XmlData::set_size(size_t size)

Sets the size of the data held in the buffer. An exception will be thrown if the size is larger than the buffer.

Parameters
size

Description: void XmlData::reserve(size_t size)

Ensures that the underlying buffer has at least size bytes, starting at offset 0. Existing data is not affected. If buffer expansion is needed and the object is a wrapper an exception is thrown.

Parameters
size

Description: size_t XmlData::getReservedSize()

Returns the size of the underlying buffer. This is at least the size of the actual data stored.


Description: void XmlData::adoptBuffer(XmlData &src)

Takes ownership of the buffer in src, leaving src with an empty buffer.

Parameters
src

APIRef

Copyright (c) 1996-2009 Oracle. All rights reserved.