3
* @file XMLStringConverter.hxx
4
* @brief The class XMLStringConverter transcode Unicode strings to local strings
6
* (C) Copyright 2005-2007 EDF-EADS-Phimeca
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License.
13
* This library is distributed in the hope that it will be useful
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
* @author: $LastChangedBy: dutka $
23
* @date: $LastChangedDate: 2008-05-21 17:44:02 +0200 (mer, 21 mai 2008) $
24
* Id: $Id: XMLStringConverter.hxx 818 2008-05-21 15:44:02Z dutka $
26
#ifndef OPENTURNS_XMLSTRINGCONVERTER_HXX
27
#define OPENTURNS_XMLSTRINGCONVERTER_HXX
29
#include <iostream> // for std::ostream
31
#include <xercesc/util/XMLUniDefs.hpp>
32
#include <xercesc/util/XMLUni.hpp>
33
#include <xercesc/util/XMLString.hpp>
35
#define XERCES XERCES_CPP_NAMESPACE_QUALIFIER
47
* @class XMLStringConverter
49
* This class can cast XML strings to STL strings.
52
class XMLStringConverter
59
explicit XMLStringConverter(const XMLCh * toTranscode)
60
: localString_(XERCES XMLString::transcode(toTranscode)) {}
64
{ XERCES XMLString::release(&localString_); }
69
operator String() const
70
{ return localString_; }
77
/** The internal form of the string in local encoding */
82
; /* class XMLStringConverter */
86
} /* namespace Common */
87
} /* namespace Base */
88
} /* namespace OpenTURNS */
90
#endif /* OPENTURNS_XMLSTRINGCONVERTER_HXX */