aGrUM 3.2.0
a C++ library for (probabilistic) graphical models
gum::XmlDocument Class Reference

An XML document, opaque over ticpp::Document. More...

#include <XmlDocument.h>

Classes

struct  Impl

Public Member Functions

 XmlDocument ()
 XmlDocument (const std::string &filePath)
 ~XmlDocument ()
 XmlDocument (XmlDocument &&) noexcept
XmlDocument & operator= (XmlDocument &&) noexcept
 XmlDocument (const XmlDocument &)=delete
XmlDocument & operator= (const XmlDocument &)=delete
void parse (const std::string &content)
void loadFile ()
 Loads the file passed to the constructor.
bool noChildren () const
XmlElement firstChildElement (const std::string &tag) const

Private Attributes

std::unique_ptr< Impl > _pimpl_

Detailed Description

An XML document, opaque over ticpp::Document.

Definition at line 125 of file XmlDocument.h.

Constructor & Destructor Documentation

◆ XmlDocument() [1/4]

gum::XmlDocument::XmlDocument ( )

Definition at line 110 of file XmlDocument.cpp.

110: _pimpl_(std::make_unique< Impl >()) {}
std::unique_ptr< Impl > _pimpl_

References _pimpl_.

Referenced by XmlDocument(), XmlDocument(), operator=(), operator=(), and parse().

Here is the caller graph for this function:

◆ XmlDocument() [2/4]

gum::XmlDocument::XmlDocument ( const std::string & filePath)
explicit

Definition at line 112 of file XmlDocument.cpp.

112 :
113 _pimpl_(std::make_unique< Impl >(filePath)) {}

References _pimpl_.

◆ ~XmlDocument()

gum::XmlDocument::~XmlDocument ( )
default

◆ XmlDocument() [3/4]

gum::XmlDocument::XmlDocument ( XmlDocument && )
defaultnoexcept

References XmlDocument().

Here is the call graph for this function:

◆ XmlDocument() [4/4]

gum::XmlDocument::XmlDocument ( const XmlDocument & )
delete

References XmlDocument().

Here is the call graph for this function:

Member Function Documentation

◆ firstChildElement()

XmlElement gum::XmlDocument::firstChildElement ( const std::string & tag) const
Exceptions
XmlExceptionif no such child exists.

Definition at line 133 of file XmlDocument.cpp.

133 {
134 try {
135 return XmlElement(_pimpl_->doc.FirstChildElement(tag));
136 } catch (ticpp::Exception& e) { throw XmlException(e.what()); }
137 }
XmlElement()=default
XmlException(std::string message)

References gum::XmlElement::XmlElement(), gum::XmlException::XmlException(), and _pimpl_.

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadFile()

void gum::XmlDocument::loadFile ( )

Loads the file passed to the constructor.

Exceptions
XmlExceptionon failure.

Definition at line 125 of file XmlDocument.cpp.

125 {
126 try {
127 _pimpl_->doc.LoadFile();
128 } catch (ticpp::Exception& e) { throw XmlException(e.what()); }
129 }

References gum::XmlException::XmlException(), and _pimpl_.

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ noChildren()

bool gum::XmlDocument::noChildren ( ) const

Definition at line 131 of file XmlDocument.cpp.

131{ return _pimpl_->doc.NoChildren(); }

References _pimpl_.

Referenced by operator=().

Here is the caller graph for this function:

◆ operator=() [1/2]

XmlDocument & gum::XmlDocument::operator= ( const XmlDocument & )
delete

References XmlDocument(), firstChildElement(), loadFile(), noChildren(), and parse().

Here is the call graph for this function:

◆ operator=() [2/2]

XmlDocument & gum::XmlDocument::operator= ( XmlDocument && )
defaultnoexcept

References XmlDocument().

Here is the call graph for this function:

◆ parse()

void gum::XmlDocument::parse ( const std::string & content)
Exceptions
XmlExceptionon a parse error.

Definition at line 119 of file XmlDocument.cpp.

119 {
120 try {
121 _pimpl_->doc.Parse(content);
122 } catch (ticpp::Exception& e) { throw XmlException(e.what()); }
123 }

References XmlDocument(), gum::XmlException::XmlException(), _pimpl_, and parse().

Referenced by operator=(), and parse().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _pimpl_

std::unique_ptr< Impl > gum::XmlDocument::_pimpl_
private

Definition at line 149 of file XmlDocument.h.

Referenced by XmlDocument(), XmlDocument(), firstChildElement(), loadFile(), noChildren(), and parse().


The documentation for this class was generated from the following files: