Exiv2::DataBuf Class Reference

Utility class containing a character array. All it does is to take care of memory allocation and deletion. Its primary use is meant to be as a stack variable in functions that need a temporary data buffer. Todo: this should be some sort of smart pointer, essentially an std::auto_ptr for a character array. But it isn't... More...

#include <types.hpp>

List of all members.

Conversions

Special conversions with auxiliary type to enable copies and assignments, similar to those used for std::auto_ptr. See http://www.josuttis.com/libbook/auto_ptr.html for a discussion.

 DataBuf (DataBufRef rhs)
DataBufoperator= (DataBufRef rhs)
 operator DataBufRef ()

Public Member Functions

Manipulators
DataBufoperator= (DataBuf &rhs)
 Assignment operator. Transfers the buffer and releases the buffer at the original object similar to std::auto_ptr, i.e., the original object is modified.
void alloc (long size)
 Allocate a data buffer of the given size.
std::pair< byte *, long > release ()
 Release ownership of the buffer to the caller. Returns the buffer as a data pointer and size pair, resets the internal buffer.
void reset (std::pair< byte *, long >=std::make_pair((byte *)(0), long(0)))
 Reset value.

Public Attributes

bytepData_
 Pointer to the buffer, 0 if none has been allocated.
long size_
 The current size of the buffer.


Detailed Description

Utility class containing a character array. All it does is to take care of memory allocation and deletion. Its primary use is meant to be as a stack variable in functions that need a temporary data buffer. Todo: this should be some sort of smart pointer, essentially an std::auto_ptr for a character array. But it isn't...


The documentation for this class was generated from the following file:
Generated on Sat Mar 1 08:38:24 2008 for Exiv2 by  doxygen 1.5.1