ReactOS 0.4.15-dev-7931-gfd331f1
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

◆ XMLFormat()

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 }
const char * _endl
Definition: xmlstorage.h:789
std::string _encoding
Definition: xmlstorage.h:792
PRETTY_FLAGS _pretty
Definition: xmlstorage.h:788
std::string _version
Definition: xmlstorage.h:791
static char * encoding
Definition: xmllint.c:155

Member Function Documentation

◆ print_header()

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

Definition at line 740 of file xmlstorage.cpp.

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}
static FILE * out
Definition: regtests2xml.c:44
std::string _public
Definition: xmlstorage.h:764
bool empty() const
Definition: xmlstorage.h:770
std::string _system
Definition: xmlstorage.h:765
std::string _name
Definition: xmlstorage.h:761
StyleSheetList _stylesheets
Definition: xmlstorage.h:796

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

Member Data Documentation

◆ _doctype

DocType XMLStorage::XMLFormat::_doctype

Definition at line 794 of file xmlstorage.h.

Referenced by XMLStorage::XMLReaderBase::parse(), and print_header().

◆ _encoding

std::string XMLStorage::XMLFormat::_encoding

Definition at line 792 of file xmlstorage.h.

Referenced by print_header(), and XMLStorage::XMLReaderBase::XmlDeclHandler().

◆ _endl

◆ _pretty

PRETTY_FLAGS XMLStorage::XMLFormat::_pretty

◆ _standalone

int XMLStorage::XMLFormat::_standalone

Definition at line 800 of file xmlstorage.h.

Referenced by print_header(), and XMLStorage::XMLReaderBase::XmlDeclHandler().

◆ _stylesheets

StyleSheetList XMLStorage::XMLFormat::_stylesheets

Definition at line 796 of file xmlstorage.h.

Referenced by XMLStorage::XMLReaderBase::parse(), and print_header().

◆ _version

std::string XMLStorage::XMLFormat::_version

Definition at line 791 of file xmlstorage.h.

Referenced by print_header(), and XMLStorage::XMLReaderBase::XmlDeclHandler().


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