1- /* ***********************************************************************
2- File: modelicaxml.h
3- Created By: Adrian Pop adrpo@ida.liu.se
4- Date: 2003-08-28 (PELAB Internal Conference)
5- Revised on 2003-10-26 17:58:42
6- Comments: some includes for the xercesc parser and a xml helper class
1+ /* ***********************************************************************
2+ File: modelicaxml.h
3+ Created By: Adrian Pop adrpo@ida.liu.se
4+ Date: 2003-08-28 (PELAB Internal Conference)
5+ Revised on 2003-10-26 17:58:42
6+ Comments: some includes for the xercesc parser and a xml helper class
77************************************************************************/
88
99#ifndef __MODELICAXML_H_
1010#define __MODELICAXML_H_
1111
12- // ---------------------------------------------------------------------------
13- // Includes
14- // ---------------------------------------------------------------------------
15- #include < xercesc/util/PlatformUtils.hpp>
16- #include < xercesc/util/XMLString.hpp>
17- #include < xercesc/dom/DOM.hpp>
18- #include < xercesc/dom/DOMWriter.hpp>
19- #include < xercesc/framework/LocalFileInputSource.hpp>
20- #include < xercesc/framework/LocalFileFormatTarget.hpp>
21- #include < xercesc/framework/StdOutFormatTarget.hpp>
22-
23- XERCES_CPP_NAMESPACE_USE
24-
25- // ---------------------------------------------------------------------------
26- // This is a simple class that lets us do easy (though not terribly efficient)
27- // trancoding of char* data to XMLCh data.
28- // ---------------------------------------------------------------------------
29- class XStr
30- {
31- public :
32- // -----------------------------------------------------------------------
33- // Constructors and Destructor
34- // -----------------------------------------------------------------------
35- XStr (const char * const toTranscode)
36- {
37- // Call the private transcoding method
38- fUnicodeForm = XMLString::transcode (toTranscode);
39- }
40-
41- ~XStr ()
42- {
43- XMLString::release (&fUnicodeForm );
44- }
45-
46-
47- // -----------------------------------------------------------------------
48- // Getter methods
49- // -----------------------------------------------------------------------
50- const XMLCh* unicodeForm () const
51- {
52- return fUnicodeForm ;
53- }
54-
55- private :
56- // -----------------------------------------------------------------------
57- // Private data members
58- //
59- // fUnicodeForm
60- // This is the Unicode XMLCh format of the string.
61- // -----------------------------------------------------------------------
62- XMLCh* fUnicodeForm ;
63- };
64-
65- #define X (str ) XStr(str).unicodeForm()
66-
67- #endif /* #ifndef _MODELICAXML_ */
12+ // ---------------------------------------------------------------------------
13+ // Includes
14+ // ---------------------------------------------------------------------------
15+ #include < xercesc/util/PlatformUtils.hpp>
16+ #include < xercesc/util/XMLString.hpp>
17+ #include < xercesc/dom/DOM.hpp>
18+ #include < xercesc/dom/DOMWriter.hpp>
19+ #include < xercesc/framework/LocalFileInputSource.hpp>
20+ #include < xercesc/framework/LocalFileFormatTarget.hpp>
21+ #include < xercesc/framework/StdOutFormatTarget.hpp>
22+
23+ XERCES_CPP_NAMESPACE_USE
24+
25+ // ---------------------------------------------------------------------------
26+ // This is a simple class that lets us do easy (though not terribly efficient)
27+ // trancoding of char* data to XMLCh data.
28+ // ---------------------------------------------------------------------------
29+ class XStr
30+ {
31+ public :
32+ // -----------------------------------------------------------------------
33+ // Constructors and Destructor
34+ // -----------------------------------------------------------------------
35+ XStr (const char * const toTranscode)
36+ {
37+ // Call the private transcoding method
38+ fUnicodeForm = XMLString::transcode (toTranscode);
39+ }
40+
41+ ~XStr ()
42+ {
43+ XMLString::release (&fUnicodeForm );
44+ }
45+
46+
47+ // -----------------------------------------------------------------------
48+ // Getter methods
49+ // -----------------------------------------------------------------------
50+ const XMLCh* unicodeForm () const
51+ {
52+ return fUnicodeForm ;
53+ }
54+
55+ private :
56+ // -----------------------------------------------------------------------
57+ // Private data members
58+ //
59+ // fUnicodeForm
60+ // This is the Unicode XMLCh format of the string.
61+ // -----------------------------------------------------------------------
62+ XMLCh* fUnicodeForm ;
63+ };
64+
65+ #define X (str ) XStr(str).unicodeForm()
66+
67+ #endif /* #ifndef _MODELICAXML_ */
0 commit comments