bakery  2.6
Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Bakery::Document_XML Class Reference

#include <Document_XML.h>

Inheritance diagram for Bakery::Document_XML:
Inheritance graph
[legend]

Public Member Functions

 Document_XML ()
 
virtual ~Document_XML ()
 
virtual bool load_after ()
 Allow app to update icons/title bar. More...
 
virtual bool save_before ()
 overrideable. More...
 
virtual void set_dtd_name (const std::string &strVal)
 
virtual std::string get_dtd_name () const
 
virtual void set_dtd_root_node_name (const Glib::ustring &strVal)
 
virtual Glib::ustring get_dtd_root_node_name () const
 
void set_write_formatted (bool formatted=true)
 Whether to add extra whitespace when writing the XML to disk. More...
 
void add_indenting_white_space ()
 Put each node on its own line and add white space for indenting, even if there are child text nodes. More...
 
virtual bool set_xml (const Glib::ustring &strXML)
 
virtual Glib::ustring get_xml () const
 
- Public Member Functions inherited from Bakery::Document
 Document ()
 
virtual ~Document ()
 
bool save ()
 
bool load ()
 
bool load_from_data (const guchar *data, std::size_t length)
 
virtual bool get_modified () const
 
virtual void set_modified (bool bVal=true)
 
virtual bool get_is_new () const
 Whether this just a default document. More...
 
void set_is_new (bool bVal)
 Called by App_WithDoc::init_create_document(). More...
 
virtual Glib::ustring get_contents () const
 
virtual void set_contents (const Glib::ustring &strVal)
 
virtual Glib::ustring get_file_uri_with_extension (const Glib::ustring &uri)
 
virtual Glib::ustring get_file_uri () const
 
virtual void set_file_uri (const Glib::ustring &file_uri, bool bEnforceFileExtension=false)
 
virtual Glib::ustring get_name () const
 Gets filename part of file_uri, or 'untitled'. More...
 
virtual bool get_read_only () const
 
virtual void set_read_only (bool bVal)
 
virtual void set_view (ViewBase *pView)
 If you don't want to use a View, then don't use set_view(). More...
 
virtual ViewBaseget_view ()
 
virtual void set_file_extension (const Glib::ustring &strVal)
 
virtual Glib::ustring get_file_extension () const
 
type_signal_modifiedsignal_modified ()
 This signal is emitted when the document has been modified. More...
 
type_signal_forgetsignal_forget ()
 This signal is emitted when the view should forget the document. More...
 

Protected Types

typedef Bakery::Document type_base
 

Protected Member Functions

virtual const xmlpp::Element * get_node_document () const
 
virtual xmlpp::Element * get_node_document ()
 
virtual void Util_DOM_Write (Glib::ustring &refstrXML) const
 
void add_indenting_white_space_to_node (xmlpp::Node *node=0, const Glib::ustring &start_indent=Glib::ustring())
 
- Protected Member Functions inherited from Bakery::Document
virtual bool read_from_disk ()
 
virtual bool write_to_disk ()
 

Static Protected Member Functions

static Glib::ustring get_node_attribute_value (const xmlpp::Element *node, const Glib::ustring &strAttributeName)
 
static void set_node_attribute_value (xmlpp::Element *node, const Glib::ustring &strAttributeName, const Glib::ustring &strValue)
 
static xmlpp::Element * get_node_child_named (const xmlpp::Element *node, const Glib::ustring &strName)
 
static xmlpp::Element * get_node_child_named_with_add (xmlpp::Element *node, const Glib::ustring &strName)
 

Protected Attributes

xmlpp::DomParser m_DOM_Parser
 
xmlpp::Document * m_pDOM_Document
 
std::string m_strDTD_Name
 
Glib::ustring m_strRootNodeName
 
bool m_write_formatted
 
- Protected Attributes inherited from Bakery::Document
Glib::ustring m_strContents
 
Glib::ustring m_file_uri
 
Glib::ustring m_file_extension
 
ViewBasem_pView
 
type_signal_modified signal_modified_
 
type_signal_forget signal_forget_
 
bool m_bModified
 
bool m_bIsNew
 
bool m_bReadOnly
 

Additional Inherited Members

- Public Types inherited from Bakery::Document
typedef sigc::signal< void, bool > type_signal_modified
 For instance, void on_document_modified(bool modified);. More...
 
typedef sigc::signal< void > type_signal_forget
 
- Static Public Member Functions inherited from Bakery::Document
static Glib::ustring util_file_uri_get_name (const Glib::ustring &file_uri, const Glib::ustring &file_extension)
 

Member Typedef Documentation

◆ type_base

Constructor & Destructor Documentation

◆ Document_XML()

Bakery::Document_XML::Document_XML ( )

◆ ~Document_XML()

virtual Bakery::Document_XML::~Document_XML ( )
virtual

Member Function Documentation

◆ add_indenting_white_space()

void Bakery::Document_XML::add_indenting_white_space ( )

Put each node on its own line and add white space for indenting, even if there are child text nodes.

set_write_formatted() does not cause nodes to be indented if there are child text nodes, because it assumes that the white space is then significant.

◆ add_indenting_white_space_to_node()

void Bakery::Document_XML::add_indenting_white_space_to_node ( xmlpp::Node *  node = 0,
const Glib::ustring &  start_indent = Glib::ustring() 
)
protected

◆ get_dtd_name()

virtual std::string Bakery::Document_XML::get_dtd_name ( ) const
virtual

◆ get_dtd_root_node_name()

virtual Glib::ustring Bakery::Document_XML::get_dtd_root_node_name ( ) const
virtual

◆ get_node_attribute_value()

static Glib::ustring Bakery::Document_XML::get_node_attribute_value ( const xmlpp::Element *  node,
const Glib::ustring &  strAttributeName 
)
staticprotected

◆ get_node_child_named()

static xmlpp::Element* Bakery::Document_XML::get_node_child_named ( const xmlpp::Element *  node,
const Glib::ustring &  strName 
)
staticprotected

◆ get_node_child_named_with_add()

static xmlpp::Element* Bakery::Document_XML::get_node_child_named_with_add ( xmlpp::Element *  node,
const Glib::ustring &  strName 
)
staticprotected

◆ get_node_document() [1/2]

virtual const xmlpp::Element* Bakery::Document_XML::get_node_document ( ) const
protectedvirtual

◆ get_node_document() [2/2]

virtual xmlpp::Element* Bakery::Document_XML::get_node_document ( )
protectedvirtual

◆ get_xml()

virtual Glib::ustring Bakery::Document_XML::get_xml ( ) const
virtual

◆ load_after()

virtual bool Bakery::Document_XML::load_after ( )
virtual

Allow app to update icons/title bar.

overrideable. Does anything which should be done after the data has been loaded from disk, but before updating the View.

Reimplemented from Bakery::Document.

◆ save_before()

virtual bool Bakery::Document_XML::save_before ( )
virtual

overrideable.

Does anything which should be done before the view has saved its data, before writing to disk..

Reimplemented from Bakery::Document.

◆ set_dtd_name()

virtual void Bakery::Document_XML::set_dtd_name ( const std::string &  strVal)
virtual

◆ set_dtd_root_node_name()

virtual void Bakery::Document_XML::set_dtd_root_node_name ( const Glib::ustring &  strVal)
virtual

◆ set_node_attribute_value()

static void Bakery::Document_XML::set_node_attribute_value ( xmlpp::Element *  node,
const Glib::ustring &  strAttributeName,
const Glib::ustring &  strValue 
)
staticprotected

◆ set_write_formatted()

void Bakery::Document_XML::set_write_formatted ( bool  formatted = true)

Whether to add extra whitespace when writing the XML to disk.

Do not use this if whitespace is significant in your XML format. See also add_indenting_white_space().

◆ set_xml()

virtual bool Bakery::Document_XML::set_xml ( const Glib::ustring &  strXML)
virtual

◆ Util_DOM_Write()

virtual void Bakery::Document_XML::Util_DOM_Write ( Glib::ustring &  refstrXML) const
protectedvirtual

Member Data Documentation

◆ m_DOM_Parser

xmlpp::DomParser Bakery::Document_XML::m_DOM_Parser
protected

◆ m_pDOM_Document

xmlpp::Document* Bakery::Document_XML::m_pDOM_Document
protected

◆ m_strDTD_Name

std::string Bakery::Document_XML::m_strDTD_Name
protected

◆ m_strRootNodeName

Glib::ustring Bakery::Document_XML::m_strRootNodeName
protected

◆ m_write_formatted

bool Bakery::Document_XML::m_write_formatted
protected

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