ATLAS Offline Software
Loading...
Searching...
No Matches
xmlUtilities.h File Reference
#include <memory>
#include <string>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOM.hpp>
#include "CxxUtils/checker_macros.h"
Include dependency graph for xmlUtilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  myXerces::Lib

Namespaces

namespace  myXerces

Typedefs

typedef std::basic_string< XMLCh > XercesString

Functions

XercesString fromNative (const char *str)
XercesString fromNative (const std::string &str)
std::string toNative (const XMLCh *str)
std::string toNative (const XercesString &str)

Variables

 ATLAS_NO_CHECK_FILE_THREAD_SAFETY

Typedef Documentation

◆ XercesString

typedef std::basic_string<XMLCh> XercesString

Definition at line 32 of file xmlUtilities.h.

Function Documentation

◆ fromNative() [1/2]

XercesString fromNative ( const char * str)
inline

Definition at line 34 of file xmlUtilities.h.

34 {
35 auto xDeleter = [&](XMLCh buf[]) {
36 xercesc::XMLString::release(&buf);
37 };
38
39 std::unique_ptr<XMLCh[], decltype(xDeleter)> ptr(xercesc::XMLString::transcode(str), xDeleter);
40
41 return XercesString(ptr.get());
42}
void * ptr(T *p)
Definition SGImplSvc.cxx:74
std::basic_string< XMLCh > XercesString

◆ fromNative() [2/2]

XercesString fromNative ( const std::string & str)
inline

Definition at line 45 of file xmlUtilities.h.

45 {
46 return fromNative(str.c_str());
47}
XercesString fromNative(const char *str)

◆ toNative() [1/2]

std::string toNative ( const XercesString & str)
inline

Definition at line 61 of file xmlUtilities.h.

61 {
62 return toNative(str.c_str());
63}
std::string toNative(const XMLCh *str)

◆ toNative() [2/2]

std::string toNative ( const XMLCh * str)
inline

Definition at line 50 of file xmlUtilities.h.

50 {
51 auto cDeleter = [&](char buf[]) {
52 xercesc::XMLString::release(&buf);
53 };
54
55 std::unique_ptr<char[], decltype(cDeleter)> ptr(xercesc::XMLString::transcode(str), cDeleter);
56
57 return std::string(ptr.get());
58}

Variable Documentation

◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY

ATLAS_NO_CHECK_FILE_THREAD_SAFETY

Definition at line 20 of file xmlUtilities.h.