Management of XML file headers and formating. More...
#include <xmlstorage.h>
Public Member Functions | |
XMLFormat (PRETTY_FLAGS pretty=PRETTY_INDENT, const std::string &encoding="utf-8", const DocType &doctype=DocType(), const std::string &xml_version="1.0") | |
XMLFormat (PRETTY_FLAGS pretty, bool utf8_bom, 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 |
bool | _utf8_bom |
bool | _inhibit_header |
DocType | _doctype |
StyleSheetList | _stylesheets |
int | _standalone |
Management of XML file headers and formating.
Definition at line 968 of file xmlstorage.h.
XMLStorage::XMLFormat::XMLFormat | ( | PRETTY_FLAGS | pretty = PRETTY_INDENT , |
const std::string & | encoding = "utf-8" , |
||
const DocType & | doctype = DocType() , |
||
const std::string & | xml_version = "1.0" |
||
) | [inline] |
Definition at line 970 of file xmlstorage.h.
References _version.
: _pretty(pretty), _endl("\n"), _encoding(encoding), _utf8_bom(false), _inhibit_header(false), _doctype(doctype), _standalone(-1) { #ifdef XS_STRICT_XML_1_0 _version = "1.0"; #else _version = xml_version; #endif }
XMLStorage::XMLFormat::XMLFormat | ( | PRETTY_FLAGS | pretty, |
bool | utf8_bom, | ||
const DocType & | doctype = DocType() |
||
) | [inline] |
Definition at line 990 of file xmlstorage.h.
: _pretty(pretty), _endl("\n"), _version("1.0"), _encoding("utf-8"), _utf8_bom(utf8_bom), _inhibit_header(false), _doctype(doctype), _standalone(-1) { }
void XMLStorage::XMLFormat::print_header | ( | std::ostream & | out, |
bool | lf = true |
||
) | const |
Definition at line 807 of file xmlstorage.cpp.
References _stricmp.
Referenced by XMLStorage::XMLDoc::write(), and XMLStorage::XMLWriter::XMLWriter().
{ if (_inhibit_header) return; if (_utf8_bom) { // write UTF-8 signature at file start out.put('\xEF'); out.put('\xBB'); out.put('\xBF'); assert(!_stricmp(_encoding.c_str(), "utf-8")); } out << "<?xml version=\"" << _version << "\" encoding=\"" << _encoding << "\""; if (_standalone != -1) out << " standalone=\"yes\""; out << "?>"; if (lf) out << _endl; if (!_doctype.empty()) { out << "<!DOCTYPE " << _doctype._name; if (!_doctype._public.empty()) { out << " PUBLIC \"" << _doctype._public << '"'; if (lf) out << _endl; out << " \"" << _doctype._system << '"'; } else if (!_doctype._system.empty()) out << " SYSTEM \"" << _doctype._system << '"'; out << "?>"; if (lf) out << _endl; } for(StyleSheetList::const_iterator it=_stylesheets.begin(); it!=_stylesheets.end(); ++it) { it->print(out); if (lf) out << _endl; } /* if (!_additional.empty()) { out << _additional; if (lf) out << _endl; } */ }
Definition at line 1012 of file xmlstorage.h.
Referenced by XMLStorage::ParseContext::process_next(), and Favorites::write().
std::string XMLStorage::XMLFormat::_encoding |
Definition at line 1008 of file xmlstorage.h.
const char* XMLStorage::XMLFormat::_endl |
Definition at line 1005 of file xmlstorage.h.
Referenced by XMLStorage::XMLReaderBase::get_endl(), XMLStorage::ParseContext::process_next(), XMLStorage::XMLDoc::read(), and XMLStorage::XMLWriter::~XMLWriter().
Definition at line 1010 of file xmlstorage.h.
Referenced by XMLStorage::HeaderlessXMLFormat::HeaderlessXMLFormat().
Definition at line 1004 of file xmlstorage.h.
Definition at line 1018 of file xmlstorage.h.
Definition at line 1014 of file xmlstorage.h.
Referenced by XMLStorage::ParseContext::process_next().
Definition at line 1009 of file xmlstorage.h.
Referenced by XMLStorage::ParseContext::process_next(), and XMLStorage::ParseContext::read_bom().
std::string XMLStorage::XMLFormat::_version |
Definition at line 1007 of file xmlstorage.h.
Referenced by XMLFormat().
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |