/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to create/tools/xerces/transcode.h

  • Committer: Suren A. Chilingaryan
  • Date: 2009-02-16 09:27:17 UTC
  • Revision ID: csa@dside.dyndns.org-20090216092717-wipyvaaw2srxhgns
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
XERCES_CPP_NAMESPACE_USE
 
2
// ---------------------------------------------------------------------------
 
3
//  This is a simple class that lets us do easy (though not terribly efficient)
 
4
//  trancoding of char* data to XMLCh data.
 
5
// ---------------------------------------------------------------------------
 
6
class XStr
 
7
{
 
8
public :
 
9
    // -----------------------------------------------------------------------
 
10
    //  Constructors and Destructor
 
11
    // -----------------------------------------------------------------------
 
12
    XStr(const char* const toTranscode)
 
13
    {
 
14
        // Call the private transcoding method
 
15
        fUnicodeForm = XMLString::transcode(toTranscode);
 
16
    }
 
17
 
 
18
    ~XStr()
 
19
    {
 
20
        delete [] fUnicodeForm;
 
21
    }
 
22
 
 
23
 
 
24
    // -----------------------------------------------------------------------
 
25
    //  Getter methods
 
26
    // -----------------------------------------------------------------------
 
27
    const XMLCh* unicodeForm() const
 
28
    {
 
29
        return fUnicodeForm;
 
30
    }
 
31
 
 
32
private :
 
33
    // -----------------------------------------------------------------------
 
34
    //  Private data members
 
35
    //
 
36
    //  fUnicodeForm
 
37
    //      This is the Unicode XMLCh format of the string.
 
38
    // -----------------------------------------------------------------------
 
39
    XMLCh*   fUnicodeForm;
 
40
};
 
41
 
 
42
#define X(str) XStr(str).unicodeForm()