C++/Tree Mapping Runtime Library
|
Class corresponding to the XML Schema hexBinary built-in type. More...
#include <types.hxx>
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_binary & | operator= (const hex_binary &x) |
Copy assignment operator. | |
std::basic_string< C > | encode () const |
Encode the buffer in hex encoding. | |
Additional Inherited Members | |
![]() | |
typedef std::size_t | size_t |
Size type. | |
![]() | |
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. | |
buffer & | operator= (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. | |
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.
|
explicit |
Allocate a buffer of the specified size.
The resulting buffer has the same size and capacity.
size | A buffer size in bytes. |
hex_binary | ( | size_t | size, |
size_t | capacity | ||
) |
Allocate a buffer of the specified size and capacity.
size | A buffer size in bytes. |
capacity | A buffer capacity in bytes. |
bounds | If size exceeds capacity |
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.
data | A buffer to copy the data from. |
size | A buffer size in bytes. |
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.
data | A buffer to copy the data from. |
size | A buffer size in bytes. |
capacity | A buffer capacity in bytes. |
bounds | If size exceeds capacity |
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()
.
data | A buffer to reuse. |
size | A buffer size in bytes. |
capacity | A buffer capacity in bytes. |
assume_ownership | A boolean value indication whether to assume ownership. |
bounds | If size exceeds capacity |
|
inline |
Copy constructor.
x | An instance to make a copy of. |
f | Flags to create the copy with. |
c | A pointer to the object that will contain the copy. |
For polymorphic object models use the _clone
function instead.
hex_binary | ( | istream< S > & | s, |
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a data representation stream.
s | A stream to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
hex_binary | ( | const xercesc::DOMElement & | e, |
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a DOM element.
e | A DOM element to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
hex_binary | ( | const xercesc::DOMAttr & | a, |
flags | f = 0 , |
||
container * | c = 0 |
||
) |
Create an instance from a DOM Attribute.
a | A DOM attribute to extract the data from. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
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.
s | A string fragment to extract the data from. |
e | A pointer to DOM element containing the string fragment. |
f | Flags to create the new instance with. |
c | A pointer to the object that will contain the new instance. |
|
virtual |
Copy the instance polymorphically.
f | Flags to create the copy with. |
c | A pointer to the object that will contain the 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.
|
inline |
Copy assignment operator.
x | An instance to assign. |
std::basic_string< C > encode | ( | ) | const |
Encode the buffer in hex encoding.