A minimal auto_ptr-like class that can copy or transcode a buffer into the local code page and free the result automatically.
More...
#include <xmltooling/unicode.h>
|
| auto_ptr_char () |
| Default constructor.
|
|
| auto_ptr_char (const XMLCh *src, bool trim=true) |
| Constructor transcodes a 16-bit Unicode string into the local code page (NOT UTF-8) and wraps the result. More...
|
|
| auto_ptr_char (const char *src, bool trim=true) |
| Constructor copies a local code page (NOT UTF-8) string and wraps the result. More...
|
|
| ~auto_ptr_char () |
| Destructor frees the wrapped buffer using the Xerces memory manager.
|
|
const char * | get () const |
| Returns the wrapped buffer. More...
|
|
char * | release () |
| Returns the wrapped buffer and transfers ownership of it to the caller. More...
|
|
A minimal auto_ptr-like class that can copy or transcode a buffer into the local code page and free the result automatically.
Needed because a standard auto_ptr would use delete on the resulting pointer.
xmltooling::auto_ptr_char::auto_ptr_char |
( |
const XMLCh * |
src, |
|
|
bool |
trim = true |
|
) |
| |
|
inline |
Constructor transcodes a 16-bit Unicode string into the local code page (NOT UTF-8) and wraps the result.
- Parameters
-
src | the 16-bit string to transcode and wrap |
trim | trims leading/trailing whitespace from the result (defaults to true) |
xmltooling::auto_ptr_char::auto_ptr_char |
( |
const char * |
src, |
|
|
bool |
trim = true |
|
) |
| |
|
inline |
Constructor copies a local code page (NOT UTF-8) string and wraps the result.
- Parameters
-
src | the local string to copy and wrap |
trim | trims leading/trailing whitespace from the result (defaults to true) |
const char* xmltooling::auto_ptr_char::get |
( |
| ) |
const |
|
inline |
Returns the wrapped buffer.
- Returns
- a null-terminated local code page string
char* xmltooling::auto_ptr_char::release |
( |
| ) |
|
|
inline |
Returns the wrapped buffer and transfers ownership of it to the caller.
- Returns
- a null-terminated local code page string
The documentation for this class was generated from the following file: