~ubuntu-branches/ubuntu/precise/glom/precise-updates

« back to all changes in this revision

Viewing changes to glom/libglom/document/bakery/document_xml.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2009-10-09 16:50:36 UTC
  • mfrom: (1.1.42 upstream)
  • Revision ID: james.westby@ubuntu.com-20091009165036-orinvwmohk838xxl
Tags: 1.12.2-0ubuntu1
* New upstream version:
  - FFE LP: #391664
* debian/control:
  - Bump python-gnome2-extras-dev build-dep to >= 2.25.3.
  - Bump libgdamm3.0-dev build-dep to libgdamm4.0-dev >= 3.99.14.
  - Change libgda3-dev build-dep to libgda-4.0-dev.
  - Change libgda3-postgres dependency to libgda-4.0-postgres.
  - Bump libgtkmm-2.4-dev build-dep to >= 2.14.
  - Add build-dep on libgconfmm-2.6-dev.
  - Bump libgoocanvasmm-dev build-dep to >= 0.14.0.
  - Remove build-dep on libbakery-2.6-dev.
  - Bump postgresql-8.3 dependency to postgresql-8.4.
  - Change scrollkeeper build-dep to rarian-compat.
  - Rename libglom{0,-dev} -> libglom-1.12-{0,dev}. Upstream include
    APIVER in the library name now.
* debian/rules:
  - Update --with-postgres-utils configure flag to point to the new
    path.
  - Drop deprecated --disable-scrollkeeper configure flag.
  - Update DEB_SHLIBDEPS_INCLUDE with new libglom-1.12-0 package name.
  - Don't include /usr/share/cdbs/1/rules/simple-patchsys.mk - there
    are currently no patches.
* debian/libglom-1.12-0.install:
  - Updated for new version.
* debian/libglom-1.12-dev.install:
  - Install pc and header files.
* debian/glom-doc.install:
  - Updated for new version.
* debian/glom.install:
  - Updated for new version.
* Fix debian/watch.
* Dropped obsolete 10-distro-install-postgres-change.patch.
* Built against latest libgoocanvasmm (LP: #428445).
* Also closes LP: #230007, LP: #393229, LP: #393231, LP: #394507,
  LP: #394887, LP: #394894, LP: #397409, LP: #381563.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2000-2002 Murray Cumming
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Library General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Library General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Library General Public
 
15
 * License along with this library; if not, write to the Free
 
16
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
17
 */
 
18
 
 
19
#ifndef GLOM_BAKERY_DOCUMENT_XML_H
 
20
#define GLOM_BAKERY_DOCUMENT_XML_H
 
21
 
 
22
#include <libglom/document/bakery/document.h>
 
23
#include <libxml++/libxml++.h>
 
24
 
 
25
//Features:
 
26
//- Read/Write to the Document in terms of XML DOM.
 
27
 
 
28
//Future features:
 
29
//- Parse the document from disk instad of memory - This *might* allow for very large documents.
 
30
 
 
31
namespace GlomBakery
 
32
{
 
33
 
 
34
class Document_XML : public GlomBakery::Document
 
35
{
 
36
public: 
 
37
  Document_XML();
 
38
  virtual ~Document_XML();
 
39
 
 
40
  //overrides:
 
41
  virtual bool load_after(int& failure_code);
 
42
  virtual bool save_before();
 
43
 
 
44
  void set_dtd_name(const std::string& strVal); //e.g. "glom.dtd"
 
45
  std::string get_dtd_name() const;
 
46
 
 
47
  /** Set the root node name and (optionally) the xmlns ID to be written 
 
48
   * when writing the document.
 
49
   * The root node name is also used when reading documents.
 
50
   */
 
51
  void set_dtd_root_node_name(const Glib::ustring& strVal, const Glib::ustring& xmlns = Glib::ustring());
 
52
  
 
53
  Glib::ustring get_dtd_root_node_name() const;
 
54
 
 
55
  /** Whether to add extra whitespace when writing the XML to disk.
 
56
   * Do not use this if whitespace is significant in your XML format.
 
57
   * See also add_indenting_white_space().
 
58
   */
 
59
  void set_write_formatted(bool formatted = true);
 
60
 
 
61
  /** Put each node on its own line and add white space for indenting,
 
62
   * even if there are child text nodes.
 
63
   * set_write_formatted() does not cause nodes to be indented if there are child text nodes,
 
64
   * because it assumes that the white space is then significant.
 
65
   */
 
66
  void add_indenting_white_space();
 
67
  
 
68
  bool set_xml(const Glib::ustring& strXML); //Parse the XML from the text.
 
69
  Glib::ustring get_xml() const; //Get the text for the XML.
 
70
 
 
71
protected:
 
72
  static Glib::ustring get_node_attribute_value(const xmlpp::Element* node, const Glib::ustring& strAttributeName);
 
73
  static void set_node_attribute_value(xmlpp::Element* node, const Glib::ustring& strAttributeName, const Glib::ustring& strValue);
 
74
 
 
75
  static xmlpp::Element* get_node_child_named(const xmlpp::Element* node, const Glib::ustring& strName);
 
76
  static xmlpp::Element* get_node_child_named_with_add(xmlpp::Element* node, const Glib::ustring& strName);
 
77
 
 
78
  const xmlpp::Element* get_node_document() const; //e.g. <glom_document> (root name)
 
79
  xmlpp::Element* get_node_document(); //e.g. <glom_document> (root name)
 
80
 
 
81
  void Util_DOM_Write(Glib::ustring& refstrXML) const;
 
82
 
 
83
  void add_indenting_white_space_to_node(xmlpp::Node* node = 0, const Glib::ustring& start_indent = Glib::ustring());
 
84
 
 
85
  typedef GlomBakery::Document type_base;
 
86
 
 
87
  //XML Parsing bits:
 
88
  xmlpp::DomParser m_DOM_Parser; //Could be mutable to allow us to guarantee a root node.
 
89
  xmlpp::Document* m_pDOM_Document; //1-to-1 with the m_DOM_Parser.
 
90
  
 
91
  std::string m_strDTD_Name;
 
92
  Glib::ustring m_strRootNodeName, m_root_xmlns;
 
93
  bool m_write_formatted;
 
94
};
 
95
 
 
96
} //namespace GlomBakery.
 
97
 
 
98
#endif // GLOM_BAKERY_DOCUMENT_XML_H