ReactOS  0.4.11-dev-745-g76daaf9
XMLStorage::XMLFormat Struct Reference

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

#include <xmlstorage.h>

Collaboration diagram for XMLStorage::XMLFormat:

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.

777  : _pretty(pretty),
778  _endl("\n"),
779  _version(xml_version),
781  _doctype(doctype),
782  _standalone(-1)
783  {
784  }
std::string _encoding
Definition: xmlstorage.h:792
const XML_Char const XML_Char * encoding
Definition: expat.h:187
PRETTY_FLAGS _pretty
Definition: xmlstorage.h:788
const char * _endl
Definition: xmlstorage.h:789
std::string _version
Definition: xmlstorage.h:791

Member Function Documentation

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

Definition at line 740 of file xmlstorage.cpp.

Referenced by XMLStorage::XMLDoc::write(), and XMLStorage::XMLWriter::XMLWriter().

741 {
742  out << "<?xml version=\"" << _version << "\" encoding=\"" << _encoding << "\"";
743 
744  if (_standalone != -1)
745  out << " standalone=\"yes\"";
746 
747  out << "?>";
748 
749  if (lf)
750  out << _endl;
751 
752  if (!_doctype.empty()) {
753  out << "<!DOCTYPE " << _doctype._name;
754 
755  if (!_doctype._public.empty()) {
756  out << " PUBLIC \"" << _doctype._public << '"';
757 
758  if (lf)
759  out << _endl;
760 
761  out << " \"" << _doctype._system << '"';
762  } else if (!_doctype._system.empty())
763  out << " SYSTEM \"" << _doctype._system << '"';
764 
765  out << "?>";
766 
767  if (lf)
768  out << _endl;
769  }
770 
771  for(StyleSheetList::const_iterator it=_stylesheets.begin(); it!=_stylesheets.end(); ++it) {
772  it->print(out);
773 
774  if (lf)
775  out << _endl;
776  }
777 
778 /* if (!_additional.empty()) {
779  out << _additional;
780 
781  if (lf)
782  out << _endl;
783  } */
784 }
std::string _encoding
Definition: xmlstorage.h:792
std::string _name
Definition: xmlstorage.h:761
bool empty() const
Definition: xmlstorage.h:770
std::string _system
Definition: xmlstorage.h:765
if(!(yy_init))
Definition: macro.lex.yy.c:717
static FILE * out
Definition: regtests2xml.c:44
const char * _endl
Definition: xmlstorage.h:789
std::string _version
Definition: xmlstorage.h:791
std::string _public
Definition: xmlstorage.h:764
StyleSheetList _stylesheets
Definition: xmlstorage.h:796

Member Data Documentation

DocType XMLStorage::XMLFormat::_doctype

Definition at line 794 of file xmlstorage.h.

Referenced by XMLStorage::XMLReaderBase::parse().

std::string XMLStorage::XMLFormat::_encoding

Definition at line 792 of file xmlstorage.h.

PRETTY_FLAGS XMLStorage::XMLFormat::_pretty

Definition at line 788 of file xmlstorage.h.

int XMLStorage::XMLFormat::_standalone

Definition at line 800 of file xmlstorage.h.

StyleSheetList XMLStorage::XMLFormat::_stylesheets

Definition at line 796 of file xmlstorage.h.

Referenced by XMLStorage::XMLReaderBase::parse().

std::string XMLStorage::XMLFormat::_version

Definition at line 791 of file xmlstorage.h.


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