Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

xml_libxerces/XmlUtils.h File Reference

#include "smbios/compat.h"
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/dom/DOMImplementationLS.hpp>
#include <xercesc/framework/StdOutFormatTarget.hpp>
#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/util/XMLUni.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
#include <xercesc/framework/Wrapper4InputSource.hpp>
#include "ExceptionImpl.h"

Go to the source code of this file.

Namespaces

namespace  xmlutils

Defines

#define X(x)   XMLString::transcode(x)
#define xmlDocGetRootElement(doc)   doc->getDocumentElement()
#define SETUP_XML_NAMESPACE   XERCES_CPP_NAMESPACE_USE
#define XML_NAMESPACE   XERCES_CPP_NAMESPACE_QUALIFIER
#define CHECK_VERSION_COMPAT
#define InitXML   XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::Initialize
#define FiniXML   XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::Terminate
#define xmlFreeParser(parser)   do{parser->resetDocumentPool(); parser->release();parser=0;}while(0)
#define xmlFreeDoc(doc)   do{doc=0;}while(0)
#define compatXmlReadFile(parser, doc, name)   do{try{doc = parser->parseURI(name);}catch( const std::exception & ){}}while(0)
#define compatXmlReadMemory(parser, doc, str, len)

Functions

 DECLARE_EXCEPTION (XmlUtilsException)
 DECLARE_EXCEPTION_EX (NotFound, xmlutils, XmlUtilsException)
 DECLARE_EXCEPTION_EX (Invalid, xmlutils, XmlUtilsException)
 DEFINE_EXCEPTION_EX (NotFoundImpl, xmlutils, NotFound)
 DEFINE_EXCEPTION_EX (InvalidImpl, xmlutils, Invalid)
XERCES_CPP_NAMESPACE_QUALIFIER
DOMElement * 
castNode2Element (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node)
const XERCES_CPP_NAMESPACE_QUALIFIER
DOMElement * 
castNode2Element (const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node)
std::string safeXMLChToString (const XMLCh *src)
std::string safeGetAttribute (const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *node, const std::string &attr)
XERCES_CPP_NAMESPACE_QUALIFIER
DOMBuilder * 
getParser ()
XERCES_CPP_NAMESPACE_QUALIFIER
DOMElement * 
findElement (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *root, const std::string elementName, const std::string &attribute, const std::string &value)
XERCES_CPP_NAMESPACE_QUALIFIER
DOMElement * 
findElementWithNumericAttr (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *root, const std::string elementName, const std::string &attribute, long value)
std::string getNodeText (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *elem)
int getNumberFromXmlAttr (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *element, const std::string field, int base)


Define Documentation

#define CHECK_VERSION_COMPAT
 

Definition at line 41 of file xml_libxerces/XmlUtils.h.

#define compatXmlReadFile parser,
doc,
name   )     do{try{doc = parser->parseURI(name);}catch( const std::exception & ){}}while(0)
 

Definition at line 47 of file xml_libxerces/XmlUtils.h.

Referenced by smbios::getSmbiosXmlDoc(), testRbu::setUp(), and testPlatform::setUp().

#define compatXmlReadMemory parser,
doc,
str,
len   ) 
 

Value:

do{ \
        try \
        {   \
            MemBufInputSource* memBufIs = new MemBufInputSource(    \
                reinterpret_cast<const XMLByte*>(stdXml),   \
                len,    \
                "standard_xml", \
                false );   \
            DOMInputSource* Is = new Wrapper4InputSource( memBufIs );   \
            doc = parser->parse( *Is ); \
            delete Is;  \
        }   \
        catch (const std::exception &)\
        {}  \
    }while(0)

Definition at line 52 of file xml_libxerces/XmlUtils.h.

Referenced by smbios::getSmbiosXmlDoc().

#define FiniXML   XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::Terminate
 

Definition at line 43 of file xml_libxerces/XmlUtils.h.

Referenced by testRbu::tearDown(), testPlatform::tearDown(), and SmbiosTableXml::~SmbiosTableXml().

#define InitXML   XERCES_CPP_NAMESPACE_QUALIFIER XMLPlatformUtils::Initialize
 

Definition at line 42 of file xml_libxerces/XmlUtils.h.

Referenced by testRbu::setUp(), testPlatform::setUp(), and SmbiosTableXml::setXmlFilePath().

#define SETUP_XML_NAMESPACE   XERCES_CPP_NAMESPACE_USE
 

Definition at line 39 of file xml_libxerces/XmlUtils.h.

#define X  )     XMLString::transcode(x)
 

Definition at line 36 of file xml_libxerces/XmlUtils.h.

#define XML_NAMESPACE   XERCES_CPP_NAMESPACE_QUALIFIER
 

Definition at line 40 of file xml_libxerces/XmlUtils.h.

#define xmlDocGetRootElement doc   )     doc->getDocumentElement()
 

Definition at line 38 of file xml_libxerces/XmlUtils.h.

Referenced by testPlatform::checkSkipTest(), smbios::getBits_FromItem(), smbios::getData_UsingXml(), smbios::getString_FromItem(), smbios::getStringForType(), testRbu::getTestInputString(), testPlatform::getTestInputString(), smbios::getTypeForString(), testPlatform::testConstructionOffset1(), testPlatform::testConstructionOffset2(), testPlatform::testOutOfBounds(), testPlatform::testVariousAccessors(), and smbios::validateSmbiosXmlDoc().

#define xmlFreeDoc doc   )     do{doc=0;}while(0)
 

Definition at line 45 of file xml_libxerces/XmlUtils.h.

Referenced by SmbiosTableXml::setXmlFilePath(), testRbu::tearDown(), testPlatform::tearDown(), smbios::validateSmbiosXmlDoc(), and SmbiosTableXml::~SmbiosTableXml().

#define xmlFreeParser parser   )     do{parser->resetDocumentPool(); parser->release();parser=0;}while(0)
 

Definition at line 44 of file xml_libxerces/XmlUtils.h.

Referenced by SmbiosTableXml::setXmlFilePath(), testRbu::tearDown(), testPlatform::tearDown(), and SmbiosTableXml::~SmbiosTableXml().


Function Documentation

const XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* castNode2Element const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  node  ) 
 

XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* castNode2Element XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  node  ) 
 

DECLARE_EXCEPTION XmlUtilsException   ) 
 

DECLARE_EXCEPTION_EX Invalid  ,
xmlutils  ,
XmlUtilsException 
 

DECLARE_EXCEPTION_EX NotFound  ,
xmlutils  ,
XmlUtilsException 
 

DEFINE_EXCEPTION_EX InvalidImpl  ,
xmlutils  ,
Invalid 
 

DEFINE_EXCEPTION_EX NotFoundImpl  ,
xmlutils  ,
NotFound 
 

XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* findElement XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  root,
const std::string  elementName,
const std::string &  attribute,
const std::string &  value
 

Referenced by testPlatform::checkSkipTest(), testRbu::getTestInputString(), testPlatform::getTestInputString(), testPlatform::testConstructionOffset1(), testPlatform::testConstructionOffset2(), testPlatform::testOutOfBounds(), and testPlatform::testVariousAccessors().

XERCES_CPP_NAMESPACE_QUALIFIER DOMElement* findElementWithNumericAttr XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  root,
const std::string  elementName,
const std::string &  attribute,
long  value
 

std::string getNodeText XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  elem  ) 
 

Referenced by testRbu::getTestInputString(), testPlatform::getTestInputString(), and testPlatform::testVariousAccessors().

int getNumberFromXmlAttr XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  element,
const std::string  field,
int  base
 

DOMBuilder * getParser  ) 
 

Definition at line 38 of file XmlUtils.cpp.

References DOMBuilder.

Referenced by testRbu::setUp(), testPlatform::setUp(), and SmbiosTableXml::setXmlFilePath().

std::string safeGetAttribute const XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  node,
const std::string &  attr
 

std::string safeXMLChToString const XMLCh *  src  ) 
 


Generated on Thu Jun 21 02:49:21 2007 for SMBIOS Library by  doxygen 1.3.9.1