COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | List of all members
XmlDoc Class Reference

#include <XmlDoc.hpp>

Inherits XmlNode.

Public Member Functions

 XmlDoc (const std::string &version=std::string(), const std::string &encoding=std::string())
 Creates an empty document. More...
 
 XmlDoc (rapidxml::xml_document< char > *doc)
 
 ~XmlDoc ()
 
void set_version (const std::string &version)
 
void set_encoding (const std::string &encoding)
 
std::string version () const
 
std::string encoding () const
 
- Public Member Functions inherited from XmlNode
 XmlNode ()
 
 XmlNode (rapidxml::xml_node< char > *impl)
 
 ~XmlNode ()
 
XmlNode add_node (const std::string &name, const std::string &value=std::string()) const
 
void set_attribute (const std::string &name, const std::string &value)
 
std::string attribute_value (const std::string &name) const
 
void set_name (const char *name)
 
void set_value (const char *value)
 
bool is_valid () const
 
void print (Uint nesting=0) const
 
void deep_copy (XmlNode &out) const
 

Additional Inherited Members

- Public Attributes inherited from XmlNode
rapidxml::xml_node< char > * content
 Pointer to the underlying XML implementation. More...
 

Detailed Description

Represents a XML document. A XML document is a special XML node that manages the memory. This class uses the Pimpl idiom. It hides the real XML implementation, which should never be used directly.
This memory management is implementation-dependent and should never be used directly.

Author
Quentin Gasper

Definition at line 36 of file XmlDoc.hpp.

Constructor & Destructor Documentation

XmlDoc ( const std::string &  version = std::string(),
const std::string &  encoding = std::string() 
)

Creates an empty document.

Definition at line 24 of file XmlDoc.cpp.

XmlDoc ( rapidxml::xml_document< char > *  doc)

Builds a document from an existing document. A declaration node is added if it is not present in the provided document.

Parameters
docDocument on which the new XmlDoc object is based.
~XmlDoc ( )

Destroys the XML document. All allocated memory is freed.

Definition at line 39 of file XmlDoc.cpp.

Member Function Documentation

std::string encoding ( ) const

Gives the document encoding.

Returns
Returns the document encoding. The string returned may be empty if no encoding was set.

Definition at line 95 of file XmlDoc.cpp.

void set_encoding ( const std::string &  encoding)

Sets the encoding of the XML document. The encoding is stored as attribute in the declaration node ("<?xml ...>"). If the node or the attribute does not exist yet, it is created.

Parameters
encodingEncoding in string format (i.e. "UTF-8").

Definition at line 79 of file XmlDoc.cpp.

void set_version ( const std::string &  version)

Sets the version of the XML document. The version is stored as attribute in the declaration node ("<?xml ...>"). If the node or the attribute does not exist yet, it is created.

Parameters
versionVersion in string format.

Definition at line 70 of file XmlDoc.cpp.

std::string version ( ) const

Gives the document version.

Returns
Returns the document version. The string returned may be empty if no version was set.

Definition at line 88 of file XmlDoc.cpp.


The documentation for this class was generated from the following files:
Send comments to:
COOLFluiD Web Admin