A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XmlWriter Class Reference

#include <genesis/utils/formats/xml/writer.hpp>

Detailed Description

Write Xml data.

Definition at line 56 of file utils/formats/xml/writer.hpp.

Public Member Functions

void to_file (const XmlDocument &document, const std::string &filename)
 Write an XML file from an XmlDocument. Return true iff successful. More...
 
void to_string (const XmlDocument &document, std::string &output)
 Give the XML string representation of a XmlDocument. More...
 
std::string to_string (const XmlDocument &document)
 Return the XML representation of a XmlDocument. More...
 

Public Attributes

int indent = 4
 Indent used for printing the XML elements. More...
 

Protected Member Functions

std::string print_attributes_list (StringMapType attr)
 Print a list of XML attributes. More...
 
void print_comment (std::string &xml, const XmlComment *value)
 Print an XML comment. More...
 
void print_element (std::string &xml, const XmlElement *value, const int indent_level)
 Print an XML element. More...
 
void print_markup (std::string &xml, const XmlMarkup *value)
 Print an XML markup (simple text). More...
 

Member Function Documentation

std::string print_attributes_list ( StringMapType  attr)
protected

Print a list of XML attributes.

Definition at line 154 of file utils/formats/xml/writer.cpp.

void print_comment ( std::string &  xml,
const XmlComment value 
)
protected

Print an XML comment.

Definition at line 93 of file utils/formats/xml/writer.cpp.

void print_element ( std::string &  xml,
const XmlElement value,
const int  indent_level 
)
protected

Print an XML element.

Definition at line 109 of file utils/formats/xml/writer.cpp.

void print_markup ( std::string &  xml,
const XmlMarkup value 
)
protected

Print an XML markup (simple text).

Definition at line 101 of file utils/formats/xml/writer.cpp.

void to_file ( const XmlDocument document,
const std::string &  filename 
)

Write an XML file from an XmlDocument. Return true iff successful.

If the file cannot be written to, the function throws an exception. Also, by default, if the file already exists, an exception is thrown. See Options::allow_file_overwriting() to change this behaviour.

Definition at line 58 of file utils/formats/xml/writer.cpp.

void to_string ( const XmlDocument document,
std::string &  output 
)

Give the XML string representation of a XmlDocument.

Definition at line 68 of file utils/formats/xml/writer.cpp.

std::string to_string ( const XmlDocument document)

Return the XML representation of a XmlDocument.

Definition at line 76 of file utils/formats/xml/writer.cpp.

Member Data Documentation

int indent = 4

Indent used for printing the XML elements.

Definition at line 89 of file utils/formats/xml/writer.hpp.


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