Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


MsgCreator.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #if !defined(MSG_CREATOR_1357924680)
20 #define MSG_CREATOR_1357924680
21 
23 
24 #include <xercesc/util/XMLString.hpp>
25 
26 
27 #include <cstring>
28 #include <cstdlib>
29 
30 #if defined(XALAN_CLASSIC_IOSTREAMS)
31 #include <iostream.h>
32 #else
33 #include <iostream>
34 #endif
35 
36 XERCES_CPP_NAMESPACE_USE
37 
38 // ---------------------------------------------------------------------------
39 // This is a simple class that lets us do easy (though not terribly efficient)
40 // trancoding of XMLCh data to local code page for display.
41 // ---------------------------------------------------------------------------
42 class StrX
43 {
44 public :
45  // -----------------------------------------------------------------------
46  // Constructors and Destructor
47  // -----------------------------------------------------------------------
48  StrX(const XMLCh* const toTranscode)
49  {
50  XALAN_USING_XERCES(XMLString)
51 
52  // Call the private transcoding method
53  fLocalForm = XMLString::transcode(toTranscode);
54  }
55 
57  {
58  XALAN_USING_XERCES(XMLString)
59 
60  XMLString::release(&fLocalForm);
61  }
62 
63  // -----------------------------------------------------------------------
64  // Getter methods
65  // -----------------------------------------------------------------------
66  const char* localForm() const
67  {
68  return fLocalForm;
69  }
70 
71 private :
72  // -----------------------------------------------------------------------
73  // Private data members
74  //
75  // fLocalForm
76  // This is the local code page form of the string.
77  // -----------------------------------------------------------------------
78  char* fLocalForm;
79 };
80 
81 #if defined(XALAN_CLASSIC_IOSTREAMS)
82 inline ostream& operator<<(ostream& target, const StrX& toDump)
83 #else
84 inline XALAN_STD_QUALIFIER ostream& operator<<(XALAN_STD_QUALIFIER ostream& target, const StrX& toDump)
85 #endif
86 {
87  target << toDump.localForm();
88  return target;
89 }
90 
91 
92 #endif //MSG_CREATOR_1357924680
93 
94 
95 
XALAN_STD_QUALIFIER ostream & operator<<(XALAN_STD_QUALIFIER ostream &target, const StrX &toDump)
Definition: MsgCreator.hpp:84
StrX(const XMLCh *const toTranscode)
Definition: MsgCreator.hpp:48
~StrX()
Definition: MsgCreator.hpp:56
const char * localForm() const
Definition: MsgCreator.hpp:66
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo