Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

unicode.h File Reference

Helper classes and types for manipulating Unicode. More...

#include <xmltooling/base.h>
#include <string>
#include <iostream>
#include <xercesc/util/XMLString.hpp>

Namespaces

namespace  xmltooling

Classes

class  xmltooling::auto_ptr_char
 A minimal auto_ptr-like class that can copy or transcode a buffer into the local code page and free the result automatically. More...
class  xmltooling::auto_ptr_XMLCh
 A minimal auto_ptr-like class that can copy or transcode a buffer into 16-bit Unicode and free the result automatically. More...
class  xmltooling::auto_arrayptr< T >
 An auto_ptr that uses array delete on its contents. More...

Typedefs

typedef std::basic_string<
XMLCh > 
xstring
 An STL string type that supports 16-bit Unicode.

Functions

char * toUTF8 (const XMLCh *src, bool use_malloc=false)
 Transcodes a 16-bit Unicode string into UTF-8.
XMLCh * fromUTF8 (const char *src, bool use_malloc=false)
 Transcodes a UTF-8 string into 16-bit Unicode.
std::ostream & operator<< (std::ostream &ostr, const XMLCh *s)
 Writes a Unicode string to an ASCII stream by transcoding to UTF8.
std::ostream & operator<< (std::ostream &ostr, const xstring &s)
 Writes a Unicode string to an ASCII stream by transcoding to UTF8.


Detailed Description

Helper classes and types for manipulating Unicode.


Function Documentation

XMLCh* fromUTF8 (  const char *  src,
bool  use_malloc = false
) 
 

Transcodes a UTF-8 string into 16-bit Unicode.

Parameters:
src the UTF-8 string to transcode
use_malloc true iff the result should be allocated with malloc, false to use new
Returns:
a 16-bit Unicode string allocated by the Xerces memory manager

std::ostream& operator<< (  std::ostream &  ostr,
const xstring &  s
) 
 

Writes a Unicode string to an ASCII stream by transcoding to UTF8.

Parameters:
ostr stream to write to
s string to write
Returns:
reference to output stream

std::ostream& operator<< (  std::ostream &  ostr,
const XMLCh *  s
) 
 

Writes a Unicode string to an ASCII stream by transcoding to UTF8.

Parameters:
ostr stream to write to
s string to write
Returns:
reference to output stream

char* toUTF8 (  const XMLCh *  src,
bool  use_malloc = false
) 
 

Transcodes a 16-bit Unicode string into UTF-8.

Parameters:
src the 16-bit string to transcode
use_malloc true iff the result should be allocated with malloc, false to use new
Returns:
a UTF-8 string allocated by the Xerces memory manager


Generated on Mon Jun 22 13:37:15 2009 for xmltooling by  doxygen 1.3.9.1