Isis 3 Developer Reference
IsisXMLChTrans.h
Go to the documentation of this file.
1 
24 #ifndef IsisXMLChTrans_h
25 #define IsisXMLChTrans_h
26 
27 #include <string>
28 #include <iostream>
29 #include <cstdlib>
30 
31 namespace XERCES = XERCES_CPP_NAMESPACE;
32 
33 // This class converts from the internal XMLCh character format to simple c strings
34 
40 class XMLChTrans {
41  public :
42  // Constructors and Destructor
43  XMLChTrans(const XMLCh *const toTranscode) {
44  // Call the private transcoding method
45  fLocalForm = XERCES::XMLString::transcode(toTranscode);
46  }
47 
49  delete [] fLocalForm;
50  }
51 
52  // Getter methods
53  const char *localForm() const {
54  return fLocalForm;
55  }
56 
57  private :
58  char *fLocalForm;
59 };
60 
61 
62 inline std::ostream &operator<<(std::ostream &target, const XMLChTrans &toDump) {
63  target << toDump.localForm();
64  return target;
65 }
66 
67 #endif
Definition: IsisXMLChTrans.h:40
const char * localForm() const
Definition: IsisXMLChTrans.h:53
std::ostream & operator<<(std::ostream &target, const XMLChTrans &toDump)
Definition: IsisXMLChTrans.h:62
XMLChTrans(const XMLCh *const toTranscode)
Definition: IsisXMLChTrans.h:43
~XMLChTrans()
Definition: IsisXMLChTrans.h:48