xmltooling::auto_ptr_XMLCh Class Reference

A minimal auto_ptr-like class that can copy or transcode a buffer into 16-bit Unicode and free the result automatically. More...

#include <xmltooling/unicode.h>

List of all members.

Public Member Functions

 auto_ptr_XMLCh ()
 Default constructor.
 auto_ptr_XMLCh (const char *src, bool trim=true)
 Constructor transcodes a local code page (NOT UTF-8) string into 16-bit Unicode and wraps the result.
 auto_ptr_XMLCh (const XMLCh *src, bool trim=true)
 Constructor copies a 16-bit Unicode string and wraps the result.
 ~auto_ptr_XMLCh ()
 Destructor frees the wrapped buffer using the Xerces memory manager.
const XMLCh * get () const
 Returns the wrapped buffer.
XMLCh * release ()
 Returns the wrapped buffer and transfers ownership of it to the caller.


Detailed Description

A minimal auto_ptr-like class that can copy or transcode a buffer into 16-bit Unicode and free the result automatically.

Needed because a standard auto_ptr would use delete on the resulting pointer.


Constructor & Destructor Documentation

xmltooling::auto_ptr_XMLCh::auto_ptr_XMLCh ( const char *  src,
bool  trim = true 
) [inline]

Constructor transcodes a local code page (NOT UTF-8) string into 16-bit Unicode and wraps the result.

Parameters:
src the local string to transcode and wrap
trim trims leading/trailing whitespace from the result (defaults to true)

xmltooling::auto_ptr_XMLCh::auto_ptr_XMLCh ( const XMLCh *  src,
bool  trim = true 
) [inline]

Constructor copies a 16-bit Unicode string and wraps the result.

Parameters:
src the Unicode string to copy and wrap
trim trims leading/trailing whitespace from the result (defaults to true)


Member Function Documentation

const XMLCh* xmltooling::auto_ptr_XMLCh::get (  )  const [inline]

Returns the wrapped buffer.

Returns:
a null-terminated Unicode string

XMLCh* xmltooling::auto_ptr_XMLCh::release (  )  [inline]

Returns the wrapped buffer and transfers ownership of it to the caller.

Returns:
a null-terminated Unicode string


The documentation for this class was generated from the following file:
Generated on Mon Oct 19 14:18:35 2009 for xmltooling by  doxygen 1.4.7