Isis Developer Reference
IsisXMLChTrans.h
Go to the documentation of this file.
1
2#ifndef IsisXMLChTrans_h
3#define IsisXMLChTrans_h
9/* SPDX-License-Identifier: CC0-1.0 */
10#include <string>
11#include <iostream>
12#include <cstdlib>
13
14namespace XERCES = XERCES_CPP_NAMESPACE;
15
16// This class converts from the internal XMLCh character format to simple c strings
17
24 public :
25 // Constructors and Destructor
26 XMLChTrans(const XMLCh *const toTranscode) {
27 // Call the private transcoding method
28 fLocalForm = XERCES::XMLString::transcode(toTranscode);
29 }
30
32 delete [] fLocalForm;
33 }
34
35 // Getter methods
36 const char *localForm() const {
37 return fLocalForm;
38 }
39
40 private :
41 char *fLocalForm;
42};
43
44
45inline std::ostream &operator<<(std::ostream &target, const XMLChTrans &toDump) {
46 target << toDump.localForm();
47 return target;
48}
49
50#endif
std::ostream & operator<<(std::ostream &target, const XMLChTrans &toDump)
Definition IsisXMLChTrans.h:45
This is free and unencumbered software released into the public domain.
Definition IsisXMLChTrans.h:23
XMLChTrans(const XMLCh *const toTranscode)
Definition IsisXMLChTrans.h:26
~XMLChTrans()
Definition IsisXMLChTrans.h:31
const char * localForm() const
Definition IsisXMLChTrans.h:36