C++/Tree Mapping Runtime Library
List of all members
hex_binary< C, B > Class Template Reference

Class corresponding to the XML Schema hexBinary built-in type. More...

#include <types.hxx>

Inheritance diagram for hex_binary< C, B >:
buffer< C >

Constructors

 hex_binary (size_t size=0)
 Allocate a buffer of the specified size.
 
 hex_binary (size_t size, size_t capacity)
 Allocate a buffer of the specified size and capacity.
 
 hex_binary (const void *data, size_t size)
 Allocate a buffer of the specified size and copy the data.
 
 hex_binary (const void *data, size_t size, size_t capacity)
 Allocate a buffer of the specified size and capacity and copy the data.
 
 hex_binary (void *data, size_t size, size_t capacity, bool assume_ownership)
 Reuse an existing buffer..
 
 hex_binary (const hex_binary &x, flags f=0, container *c=0)
 Copy constructor.
 
virtual hex_binary_clone (flags f=0, container *c=0) const
 Copy the instance polymorphically.
 
template<typename S >
 hex_binary (istream< S > &s, flags f=0, container *c=0)
 Create an instance from a data representation stream.
 
 hex_binary (const xercesc::DOMElement &e, flags f=0, container *c=0)
 Create an instance from a DOM element.
 
 hex_binary (const xercesc::DOMAttr &a, flags f=0, container *c=0)
 Create an instance from a DOM Attribute.
 
 hex_binary (const std::basic_string< C > &s, const xercesc::DOMElement *e, flags f=0, container *c=0)
 Create an instance from a string fragment.
 
hex_binaryoperator= (const hex_binary &x)
 Copy assignment operator.
 
std::basic_string< C > encode () const
 Encode the buffer in hex encoding.
 

Additional Inherited Members

- Public Types inherited from buffer< C >
typedef std::size_t size_t
 Size type.
 
- Public Member Functions inherited from buffer< C >
 buffer (size_t size=0)
 Allocate a buffer of the specified size.
 
 buffer (size_t size, size_t capacity)
 Allocate a buffer of the specified size and capacity.
 
 buffer (const void *data, size_t size)
 Allocate a buffer of the specified size and copy the data.
 
 buffer (const void *data, size_t size, size_t capacity)
 Allocate a buffer of the specified size and capacity and copy the data.
 
 buffer (void *data, size_t size, size_t capacity, bool assume_ownership)
 Reuse an existing buffer.
 
 buffer (const buffer &x)
 Copy constructor.
 
bufferoperator= (const buffer &x)
 Copy assignment operator.
 
size_t capacity () const
 Get buffer's capacity.
 
bool capacity (size_t c)
 Set buffer's capacity.
 
size_t size () const
 Get buffer's size.
 
bool size (size_t s)
 Set buffer's size.
 
const char * data () const
 Get the underlying memory region.
 
char * data ()
 Get the underlying memory region.
 
const char * begin () const
 Get the beginning of the underlying memory region.
 
char * begin ()
 Get the beginning of the underlying memory region.
 
const char * end () const
 Get the end of the underlying memory region.
 
char * end ()
 Get the end of the underlying memory region.
 
void swap (buffer &x)
 Swap data with another buffer.
 

Detailed Description

template<typename C, typename B>
class xsd::cxx::tree::hex_binary< C, B >

Class corresponding to the XML Schema hexBinary built-in type.

The hex_binary class is a binary buffer abstraction with hex-encoded representation in XML. It publicly inherits from the buffer class which provides the buffer functionality.

Constructor & Destructor Documentation

◆ hex_binary() [1/10]

template<typename C , typename B >
hex_binary ( size_t  size = 0)
explicit

Allocate a buffer of the specified size.

The resulting buffer has the same size and capacity.

Parameters
sizeA buffer size in bytes.

◆ hex_binary() [2/10]

template<typename C , typename B >
hex_binary ( size_t  size,
size_t  capacity 
)

Allocate a buffer of the specified size and capacity.

Parameters
sizeA buffer size in bytes.
capacityA buffer capacity in bytes.
Exceptions
boundsIf size exceeds capacity

◆ hex_binary() [3/10]

template<typename C , typename B >
hex_binary ( const void *  data,
size_t  size 
)

Allocate a buffer of the specified size and copy the data.

The resulting buffer has the same size and capacity with size bytes copied from data.

Parameters
dataA buffer to copy the data from.
sizeA buffer size in bytes.

◆ hex_binary() [4/10]

template<typename C , typename B >
hex_binary ( const void *  data,
size_t  size,
size_t  capacity 
)

Allocate a buffer of the specified size and capacity and copy the data.

size bytes are copied from data to the resulting buffer.

Parameters
dataA buffer to copy the data from.
sizeA buffer size in bytes.
capacityA buffer capacity in bytes.
Exceptions
boundsIf size exceeds capacity

◆ hex_binary() [5/10]

template<typename C , typename B >
hex_binary ( void *  data,
size_t  size,
size_t  capacity,
bool  assume_ownership 
)

Reuse an existing buffer..

If the assume_ownership argument is true, the buffer will assume ownership of data and will release the memory by calling operator delete().

Parameters
dataA buffer to reuse.
sizeA buffer size in bytes.
capacityA buffer capacity in bytes.
assume_ownershipA boolean value indication whether to assume ownership.
Exceptions
boundsIf size exceeds capacity

◆ hex_binary() [6/10]

template<typename C , typename B >
hex_binary ( const hex_binary< C, B > &  x,
flags  f = 0,
container c = 0 
)
inline

Copy constructor.

Parameters
xAn instance to make a copy of.
fFlags to create the copy with.
cA pointer to the object that will contain the copy.

For polymorphic object models use the _clone function instead.

◆ hex_binary() [7/10]

template<typename C , typename B >
template<typename S >
hex_binary ( istream< S > &  s,
flags  f = 0,
container c = 0 
)

Create an instance from a data representation stream.

Parameters
sA stream to extract the data from.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

◆ hex_binary() [8/10]

template<typename C , typename B >
hex_binary ( const xercesc::DOMElement &  e,
flags  f = 0,
container c = 0 
)

Create an instance from a DOM element.

Parameters
eA DOM element to extract the data from.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

◆ hex_binary() [9/10]

template<typename C , typename B >
hex_binary ( const xercesc::DOMAttr &  a,
flags  f = 0,
container c = 0 
)

Create an instance from a DOM Attribute.

Parameters
aA DOM attribute to extract the data from.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

◆ hex_binary() [10/10]

template<typename C , typename B >
hex_binary ( const std::basic_string< C > &  s,
const xercesc::DOMElement *  e,
flags  f = 0,
container c = 0 
)

Create an instance from a string fragment.

Parameters
sA string fragment to extract the data from.
eA pointer to DOM element containing the string fragment.
fFlags to create the new instance with.
cA pointer to the object that will contain the new instance.

Member Function Documentation

◆ _clone()

template<typename C , typename B >
virtual hex_binary * _clone ( flags  f = 0,
container c = 0 
) const
virtual

Copy the instance polymorphically.

Parameters
fFlags to create the copy with.
cA pointer to the object that will contain the copy.
Returns
A pointer to the dynamically allocated copy.

This function ensures that the dynamic type of the instance is used for copying and should be used for polymorphic object models instead of the copy constructor.

◆ operator=()

template<typename C , typename B >
hex_binary & operator= ( const hex_binary< C, B > &  x)
inline

Copy assignment operator.

Parameters
xAn instance to assign.
Returns
A reference to the instance.

◆ encode()

template<typename C , typename B >
std::basic_string< C > encode ( ) const

Encode the buffer in hex encoding.

Returns
A string with hex-encoded data.

The documentation for this class was generated from the following file:

Copyright © 2005-2023 Code Synthesis.