Document_XML.h
bakery/Document/Document.h
libxml++/libxml++.h
bakery.h
ViewBase.h
Document_XML.h
libxml++/libxml++.h
sigc++/sigc++.h
bakery/Document/Document.h
iostream
sigc++/trackable.h
bakery/View/View.h
glibmm.h
bakery.h
Document_XML.h
Bakery::Document_XML
Bakery

    /*
    *Copyright2000-2002MurrayCumming
    *
    *Thislibraryisfreesoftware;youcanredistributeitand/or
    *modifyitunderthetermsoftheGNULibraryGeneralPublic
    *LicenseaspublishedbytheFreeSoftwareFoundation;either
    *version2oftheLicense,or(atyouroption)anylaterversion.
    *
    *Thislibraryisdistributedinthehopethatitwillbeuseful,
    *butWITHOUTANYWARRANTY;withouteventheimpliedwarrantyof
    *MERCHANTABILITYorFITNESSFORAPARTICULARPURPOSE.SeetheGNU
    *LibraryGeneralPublicLicenseformoredetails.
    *
    *YoushouldhavereceivedacopyoftheGNULibraryGeneralPublic
    *Licensealongwiththislibrary;ifnot,writetotheFree
    *SoftwareFoundation,Inc.,675MassAve,Cambridge,MA02139,USA.
    */

    #ifndefBAKERY_DOCUMENT_XML_H
    #defineBAKERY_DOCUMENT_XML_H

    #include"bakery/Document/Document.h"
    #include<libxml++/libxml++.h>

    //Features:
    //-Read/WritetotheDocumentintermsofXMLDOM.

    //Futurefeatures:
    //-Parsethedocumentfromdiskinstadofmemory-This*might*allowforverylargedocuments.

    namespaceBakery
    {

    classDocument_XML:publicBakery::Document
    {
    public:
    Document_XML();
    virtual~Document_XML();

    //overrides:
    virtualboolload_after();
    virtualboolsave_before();

    virtualvoidset_dtd_name(conststd::string&strVal);//e.g."glom.dtd"
    virtualstd::stringget_dtd_name()const;

    virtualvoidset_dtd_root_node_name(constGlib::ustring&strVal);
    virtualGlib::ustringget_dtd_root_node_name()const;

    voidset_write_formatted(boolformatted=true);

    voidadd_indenting_white_space();

    virtualboolset_xml(constGlib::ustring&strXML);//ParsetheXMLfromthetext.
    virtualGlib::ustringget_xml()const;//GetthetextfortheXML.

    protected:
    staticGlib::ustringget_node_attribute_value(constxmlpp::Element*node,constGlib::ustring&strAttributeName);
    staticvoidset_node_attribute_value(xmlpp::Element*node,constGlib::ustring&strAttributeName,constGlib::ustring&strValue);

    staticxmlpp::Element*get_node_child_named(constxmlpp::Element*node,constGlib::ustring&strName);
    staticxmlpp::Element*get_node_child_named_with_add(xmlpp::Element*node,constGlib::ustring&strName);

    virtualconstxmlpp::Element*get_node_document()const;//e.g.<glom_document>(rootname)
    virtualxmlpp::Element*get_node_document();//e.g.<glom_document>(rootname)

    virtualvoidUtil_DOM_Write(Glib::ustring&refstrXML)const;

    voidadd_indenting_white_space_to_node(xmlpp::Node*node=0,constGlib::ustring&start_indent=Glib::ustring());

    typedefBakery::Documenttype_base;

    //XMLParsingbits:
    xmlpp::DomParserm_DOM_Parser;//Couldbemutabletoallowustoguaranteearootnode.
    xmlpp::Document*m_pDOM_Document;//1-to-1withthem_DOM_Parser.

    std::stringm_strDTD_Name;
    Glib::ustringm_strRootNodeName;
    boolm_write_formatted;
    };

    }//namespaceBakery.

    #endif//BAKERY_DOCUMENT_XML_H