Public Member Functions | Public Attributes

xmlstorage::XMLFormat Class Reference

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

Collaboration diagram for xmlstorage::XMLFormat:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 this (PRETTY_FLAGS pretty=PRETTY_FLAGS.PRETTY_INDENT, in char[] xml_version="1.0", in char[] encoding="utf-8", in DocType doctype=new DocType)
void print_header (Stream o, bool lf=true)

Public Attributes

PRETTY_FLAGS _pretty
char[] _endl
char[] _version
char[] _encoding
DocType _doctype
StyleSheetList _stylesheets
int _standalone

Detailed Description

Management of XML file headers and formating.

Definition at line 413 of file xmlstorage.d.


Constructor & Destructor Documentation

xmlstorage::XMLFormat::this ( PRETTY_FLAGS  pretty = PRETTY_FLAGS.PRETTY_INDENT,
in char[]  xml_version = "1.0",
in char[]  encoding = "utf-8",
in DocType  doctype = new DocType 
) [inline]

Definition at line 416 of file xmlstorage.d.

    {
        _pretty = pretty;
        _endl = "\n";
        _version = xml_version;
        _encoding = encoding;
        _doctype = doctype;
        _standalone = -1;

        _stylesheets = new StyleSheetList;
    }

Member Function Documentation

void xmlstorage::XMLFormat::print_header ( Stream  o,
bool  lf = true 
) [inline]

Definition at line 428 of file xmlstorage.d.

    {
        o.writeString("<?xml version=\"" ~ _version ~ "\" encoding=\"" ~ _encoding ~ "\"");

        if (_standalone != -1)
            o.writeString(" standalone=\"yes\"");

        o.writeString("?>");

        if (lf)
            o.writeString(_endl);

        if (!_doctype.empty()) {
            o.writeString("<!DOCTYPE " ~ _doctype._name);

            if (_doctype._public.length) {
                o.writeString(" PUBLIC \"" ~ _doctype._public ~ '"');

                if (lf)
                    o.writeString(_endl);

                o.writeString(" \"" ~ _doctype._system ~ '"');
            } else if (_doctype._system.length)
                o.writeString(" SYSTEM \"" ~ _doctype._system ~ '"');

            o.writeString("?>");

            if (lf)
                o.writeString(_endl);
        }

        foreach(it; _stylesheets) {
            it.print(o);

            if (lf)
                o.writeString(_endl);
        }

    /*  if (!_additional.empty()) {
            o.writeString(_additional);

            if (lf)
                o.writeString(_endl;
        } */
    }

Member Data Documentation

Definition at line 480 of file xmlstorage.d.

Definition at line 478 of file xmlstorage.d.

Definition at line 474 of file xmlstorage.d.

Definition at line 486 of file xmlstorage.d.

Definition at line 482 of file xmlstorage.d.

Definition at line 477 of file xmlstorage.d.


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