XMLStorage::XMLFormat Struct Reference

Management of XML file headers and formating. More...

#include <xmlstorage.h>

Inheritance diagram for XMLStorage::XMLFormat:

Inheritance graph
[legend]
Collaboration diagram for XMLStorage::XMLFormat:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 XMLFormat (PRETTY_FLAGS pretty=PRETTY_INDENT, const std::string &xml_version="1.0", const std::string &encoding="utf-8", const DocType &doctype=DocType())
void print_header (std::ostream &out, bool lf=true) const

Public Attributes

PRETTY_FLAGS _pretty
const char * _endl
std::string _version
std::string _encoding
DocType _doctype
StyleSheetList _stylesheets
int _standalone


Detailed Description

Management of XML file headers and formating.

Definition at line 774 of file xmlstorage.h.


Constructor & Destructor Documentation

XMLStorage::XMLFormat::XMLFormat ( PRETTY_FLAGS  pretty = PRETTY_INDENT,
const std::string &  xml_version = "1.0",
const std::string &  encoding = "utf-8",
const DocType doctype = DocType() 
) [inline]

Definition at line 776 of file xmlstorage.h.

References XMLStorage::PRETTY_INDENT.

00776 {
00777     XMLFormat(PRETTY_FLAGS pretty=PRETTY_INDENT, const std::string& xml_version="1.0", const std::string& encoding="utf-8", const DocType& doctype=DocType())
00778      :  _pretty(pretty),
00779         _endl("\n"),
00780         _version(xml_version),
00781         _encoding(encoding),
00782         _doctype(doctype),
00783         _standalone(-1)
00784     {


Member Function Documentation

void XMLStorage::XMLFormat::print_header ( std::ostream &  out,
bool  lf = true 
) const

Definition at line 734 of file xmlstorage.cpp.

00739 {
00740     out << "<?xml version=\"" << _version << "\" encoding=\"" << _encoding << "\"";
00741 
00742     if (_standalone != -1)
00743         out << " standalone=\"yes\"";
00744 
00745     out << "?>";
00746 
00747     if (lf)
00748         out << _endl;
00749 
00750     if (!_doctype.empty()) {
00751         out << "<!DOCTYPE " << _doctype._name;
00752 
00753         if (!_doctype._public.empty()) {
00754             out << " PUBLIC \"" << _doctype._public << '"';
00755 
00756             if (lf)
00757                 out << _endl;
00758 
00759             out << " \"" << _doctype._system << '"';
00760         } else if (!_doctype._system.empty())
00761             out << " SYSTEM \"" << _doctype._system << '"';
00762 
00763         out << "?>";
00764 
00765         if (lf)
00766             out << _endl;
00767     }
00768 
00769     for(StyleSheetList::const_iterator it=_stylesheets.begin(); it!=_stylesheets.end(); ++it) {
00770         it->print(out);
00771 
00772         if (lf)
00773             out << _endl;
00774     }
00775 
00776 /*  if (!_additional.empty()) {
00777         out << _additional;
00778 


Member Data Documentation

PRETTY_FLAGS XMLStorage::XMLFormat::_pretty

Definition at line 788 of file xmlstorage.h.

const char* XMLStorage::XMLFormat::_endl

Definition at line 789 of file xmlstorage.h.

Referenced by XMLStorage::XMLDoc::read().

std::string XMLStorage::XMLFormat::_version

Definition at line 791 of file xmlstorage.h.

std::string XMLStorage::XMLFormat::_encoding

Definition at line 792 of file xmlstorage.h.

DocType XMLStorage::XMLFormat::_doctype

Definition at line 794 of file xmlstorage.h.

Referenced by get_html_page().

StyleSheetList XMLStorage::XMLFormat::_stylesheets

Definition at line 796 of file xmlstorage.h.

int XMLStorage::XMLFormat::_standalone

Definition at line 800 of file xmlstorage.h.


The documentation for this struct was generated from the following files:
Generated on Mon Aug 30 00:05:50 2010 for XMLStorage/C++ by  doxygen 1.5.4