[gxml] Remove all throws declarations, since we're shifting to a document-level error variable



commit 4a4fa3fa3cf2998e6b0225e15a631c4a55c80410
Author: Richard Schwarting <aquarichy gmail com>
Date:   Sat Jul 27 00:00:18 2013 -0400

    Remove all throws declarations, since we're shifting to a document-level error variable

 gxml/Attr.vala       |    8 ++++----
 gxml/BackedNode.vala |    4 ++--
 gxml/Document.vala   |   30 +++++++++++++++---------------
 gxml/DomNode.vala    |    8 ++++----
 gxml/Element.vala    |   16 ++++++++--------
 gxml/Entity.vala     |    8 ++++----
 gxml/NodeList.vala   |    4 ++--
 gxml/Text.vala       |    2 +-
 8 files changed, 40 insertions(+), 40 deletions(-)
---
diff --git a/gxml/Attr.vala b/gxml/Attr.vala
index 82b178a..f86ad16 100644
--- a/gxml/Attr.vala
+++ b/gxml/Attr.vala
@@ -225,25 +225,25 @@ namespace GXml {
                /**
                 * { inheritDoc}
                 */
-               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) throws 
DomError {
+               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) {
                        return this.child_nodes.insert_before (new_child, ref_child);
                }
                /**
                 * { inheritDoc}
                 */
-               public override DomNode? replace_child (DomNode new_child, DomNode old_child) throws DomError 
{
+               public override DomNode? replace_child (DomNode new_child, DomNode old_child) {
                        return this.child_nodes.replace_child (new_child, old_child);
                }
                /**
                 * { inheritDoc}
                 */
-               public override DomNode? remove_child (DomNode old_child) throws DomError {
+               public override DomNode? remove_child (DomNode old_child) {
                        return this.child_nodes.remove_child (old_child);
                }
                /**
                 * { inheritDoc}
                 */
-               public override DomNode? append_child (DomNode new_child) throws DomError {
+               public override DomNode? append_child (DomNode new_child) {
                        return this.child_nodes.append_child (new_child);
                }
                /**
diff --git a/gxml/BackedNode.vala b/gxml/BackedNode.vala
index eec8e98..3685557 100644
--- a/gxml/BackedNode.vala
+++ b/gxml/BackedNode.vala
@@ -250,13 +250,13 @@ namespace GXml {
                /**
                 * { inheritDoc}
                 */
-               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) throws 
DomError {
+               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) {
                        return this.child_nodes.insert_before (new_child, ref_child);
                }
                /**
                 * { inheritDoc}
                 */
-               public override DomNode? replace_child (DomNode new_child, DomNode old_child) throws DomError 
{
+               public override DomNode? replace_child (DomNode new_child, DomNode old_child) {
                        return this.child_nodes.replace_child (new_child, old_child);
                }
                /**
diff --git a/gxml/Document.vala b/gxml/Document.vala
index 089c49b..6e03748 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -235,7 +235,7 @@ namespace GXml {
                /**
                 * Creates a Document based on a libxml2 Xml.Doc* object.
                 */
-               public Document.from_libxml2 (Xml.Doc *doc, bool require_root = true) throws DomError {
+               public Document.from_libxml2 (Xml.Doc *doc, bool require_root = true) {
                        /* All other constructors should call this one,
                           passing it a Xml.Doc* object */
 
@@ -267,7 +267,7 @@ namespace GXml {
                 *
                 * @throws DomError When a Document cannot be constructed for the specified file.
                 */
-               public Document.from_path (string file_path) throws DomError {
+               public Document.from_path (string file_path) {
                        Xml.Doc *doc = Xml.Parser.parse_file (file_path); // consider using read_file
                        // TODO: might want to check that the file_path exists
                        this.from_libxml2 (doc);
@@ -350,7 +350,7 @@ namespace GXml {
                 *
                 * @throws DomError When a Document cannot be constructed for the specified file.
                 */
-               public Document.from_gfile (File fin, Cancellable? can = null) throws DomError {
+               public Document.from_gfile (File fin, Cancellable? can = null) {
                        // TODO: accept cancellable
                        InputStream instream;
 
@@ -367,7 +367,7 @@ namespace GXml {
                 *
                 * @throws DomError When a Document cannot be constructed for the specified stream.
                 */
-               public Document.from_stream (InputStream instream, Cancellable? can = null) throws DomError {
+               public Document.from_stream (InputStream instream, Cancellable? can = null) {
                        // TODO: accept Cancellable
                        // Cancellable can = new Cancellable ();
                        InputStreamBox box = { instream, can };
@@ -387,7 +387,7 @@ namespace GXml {
                 *
                 * @throws DomError When a Document cannot be constructed for the specified data.
                 */
-               public Document.from_string (string memory) throws DomError {
+               public Document.from_string (string memory) {
                        /* TODO: consider breaking API to support
                         * xmlParserOptions, encoding, and base URL
                         * from xmlReadMemory */
@@ -397,7 +397,7 @@ namespace GXml {
                /**
                 * Creates an empty document.
                 */
-               public Document () throws DomError {
+               public Document () {
                        Xml.Doc *doc = new Xml.Doc ();
                        this.from_libxml2 (doc, false);
                }
@@ -447,7 +447,7 @@ namespace GXml {
                /**
                 * Saves a Document to the OutputStream outstream.
                 */
-               public void save_to_stream (OutputStream outstream, Cancellable? can = null) throws DomError {
+               public void save_to_stream (OutputStream outstream, Cancellable? can = null) {
                        OutputStreamBox box = { outstream, can };
 
                        sync_dirty_elements ();
@@ -466,7 +466,7 @@ namespace GXml {
                 * Creates an empty Element node with the tag name
                 * tag_name. XML example: {{{<Person></Person>}}}
                 */
-               public Element create_element (string tag_name) throws DomError {
+               public Element create_element (string tag_name) {
                        /* TODO: libxml2 doesn't complain about invalid names, but the spec
                           for DOM Level 1 Core wants us to. Handle ourselves? */
                        // TODO: what does libxml2 do with Elements?  should we just use nodes? probably
@@ -508,7 +508,7 @@ namespace GXml {
                 * XML entities.]]>. }}}
                 */
                // TODO: figure out how we can represent ]] in a Valadoc
-               public CDATASection create_cdata_section (string data) throws DomError {
+               public CDATASection create_cdata_section (string data) {
                        check_html ("CDATA section"); // TODO: i18n
 
                        return new CDATASection (this.xmldoc->new_cdata_block (data, (int)data.length), this);
@@ -518,7 +518,7 @@ namespace GXml {
                 * {{{<?pi_target processing instruction data?>
                 * <?xml-stylesheet href="style.xsl" type="text/xml"?>}}}
                 */
-               public ProcessingInstruction create_processing_instruction (string target, string data) 
throws DomError {
+               public ProcessingInstruction create_processing_instruction (string target, string data) {
                        check_html ("processing instructions"); // TODO: i18n
                        check_character_validity (target);
                        check_character_validity (data); // TODO: do these use different rules?
@@ -532,7 +532,7 @@ namespace GXml {
                /**
                 * Creates an Attr attribute with name, usually to be associated with an Element.
                 */
-               public Attr create_attribute (string name) throws DomError {
+               public Attr create_attribute (string name) {
                        check_character_validity (name);
 
                        return new Attr (this.xmldoc->new_prop (name, ""), this);
@@ -543,7 +543,7 @@ namespace GXml {
                 * {{{&name;
                 * &apos;}}}
                 */
-               public EntityReference create_entity_reference (string name) throws DomError {
+               public EntityReference create_entity_reference (string name) {
                        check_html ("entity reference"); // TODO: i18n
                        check_character_validity (name);
 
@@ -565,13 +565,13 @@ namespace GXml {
                        return this.document_element.get_elements_by_tag_name (tag_name);
                }
 
-               private void check_html (string feature) throws DomError {
+               private void check_html (string feature) {
                        if (this.doctype != null && this.doctype.name == "html") {
                                // TODO: ^ check name == html by icase
                                this.last_error = new DomError.NOT_SUPPORTED ("HTML documents do not support 
'%s'".printf (feature)); // i18n
                        }
                }
-               private void check_character_validity (string str) throws DomError {
+               private void check_character_validity (string str) {
                        if (true == false) { // TODO: define validity
                                this.last_error = new DomError.INVALID_CHARACTER ("'%s' contains invalid 
characters.".printf (str));
                        }
@@ -595,7 +595,7 @@ namespace GXml {
                 *
                 * @return The newly added child.
                 */
-               public override DomNode? append_child (DomNode new_child) throws DomError {
+               public override DomNode? append_child (DomNode new_child) {
                        if (new_child.node_type == NodeType.ELEMENT) {
                                if (xmldoc->get_root_element () == null) {
                                        xmldoc->set_root_element (((Element)new_child).node);
diff --git a/gxml/DomNode.vala b/gxml/DomNode.vala
index 2082f3e..a2eb62b 100644
--- a/gxml/DomNode.vala
+++ b/gxml/DomNode.vala
@@ -309,7 +309,7 @@ namespace GXml {
                 *
                 * @return `new_child`, the node that has been inserted
                 */
-               public virtual DomNode? insert_before (DomNode new_child, DomNode? ref_child) throws DomError 
{
+               public virtual DomNode? insert_before (DomNode new_child, DomNode? ref_child) {
                        return null;
                }
                /**
@@ -320,7 +320,7 @@ namespace GXml {
                 *
                 * @return The removed node `old_child`.
                 */
-               public virtual DomNode? replace_child (DomNode new_child, DomNode old_child) throws DomError {
+               public virtual DomNode? replace_child (DomNode new_child, DomNode old_child) {
                        return null;
                }
                /**
@@ -331,7 +331,7 @@ namespace GXml {
                 *
                 * @return The removed node `old_child`.
                 */
-               public virtual DomNode? remove_child (DomNode old_child) throws DomError {
+               public virtual DomNode? remove_child (DomNode old_child) {
                        return null;
                }
                /**
@@ -342,7 +342,7 @@ namespace GXml {
                 *
                 * @return The newly added child.
                 */
-               public virtual DomNode? append_child (DomNode new_child) throws DomError {
+               public virtual DomNode? append_child (DomNode new_child) {
                        return null;
                }
                /**
diff --git a/gxml/Element.vala b/gxml/Element.vala
index ad2a53b..51bf1e3 100644
--- a/gxml/Element.vala
+++ b/gxml/Element.vala
@@ -243,7 +243,7 @@ namespace GXml {
                 * @param name Name of the attribute whose value to set.
                 * @param value The value to set.
                 */
-               public void set_attribute (string name, string value) throws DomError {
+               public void set_attribute (string name, string value) {
                        // don't need to use insert
                        Attr attr = this.attributes.lookup (name);
                        if (attr == null) {
@@ -269,7 +269,7 @@ namespace GXml {
                 *
                 * @param name The name of the attribute to unset.
                 */
-               public void remove_attribute (string name) throws DomError {
+               public void remove_attribute (string name) {
                        this.attributes.remove (name);
                }
                /**
@@ -298,7 +298,7 @@ namespace GXml {
                 * is replaced and the old Attr is returned.
                 * Elsewise, null is returned.
                 */
-               public Attr set_attribute_node (Attr new_attr) throws DomError {
+               public Attr set_attribute_node (Attr new_attr) {
                        // TODO: need to actually associate this with the libxml2 structure!
                        // TODO: need to do that at the time of saving. We don't right now :|
                        Attr old = this.attributes.lookup (new_attr.name);
@@ -318,7 +318,7 @@ namespace GXml {
                 * @return The old_attr we wanted to remove, even if
                 * it wasn't found.
                 */
-               public Attr remove_attribute_node (Attr old_attr) throws DomError {
+               public Attr remove_attribute_node (Attr old_attr) {
                        // TODO: need to check for nulls. < Nope, ? controls that.
                        this.attributes.remove (old_attr.name);
                        return old_attr;
@@ -358,23 +358,23 @@ namespace GXml {
                }
 
                /* ** DomNode methods ** */
-               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) throws 
DomError {
+               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) {
                        DomNode ret = base.insert_before (new_child, ref_child);
                        check_add_tag_name (this, new_child);
                        return ret;
                }
-               public override DomNode? replace_child (DomNode new_child, DomNode old_child) throws DomError 
{
+               public override DomNode? replace_child (DomNode new_child, DomNode old_child) {
                        check_remove_tag_name (this, old_child);
                        DomNode ret = base.replace_child (new_child, old_child);
                        check_add_tag_name (this, new_child);
                        return ret;
                }
-               public override DomNode? remove_child (DomNode old_child) throws DomError {
+               public override DomNode? remove_child (DomNode old_child) {
                        check_remove_tag_name (this, old_child);
                        DomNode ret = base.remove_child (old_child);
                        return ret;
                }
-               public override DomNode? append_child (DomNode new_child) throws DomError {
+               public override DomNode? append_child (DomNode new_child) {
                        DomNode ret = base.append_child (new_child);
                        check_add_tag_name (this, new_child);
                        return ret;
diff --git a/gxml/Entity.vala b/gxml/Entity.vala
index 68b44a7..e293e61 100644
--- a/gxml/Entity.vala
+++ b/gxml/Entity.vala
@@ -109,16 +109,16 @@ namespace GXml {
                }
 
                /* Public methods (Node-specific) */
-               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) throws 
DomError {
+               public override DomNode? insert_before (DomNode new_child, DomNode? ref_child) {
                        return this.child_nodes.insert_before (new_child, ref_child);
                }
-               public override DomNode? replace_child (DomNode new_child, DomNode old_child) throws DomError 
{
+               public override DomNode? replace_child (DomNode new_child, DomNode old_child) {
                        return this.child_nodes.replace_child (new_child, old_child);
                }
-               public override DomNode? remove_child (DomNode old_child) throws DomError {
+               public override DomNode? remove_child (DomNode old_child) {
                        return this.child_nodes.remove_child (old_child);
                }
-               public override DomNode? append_child (DomNode new_child) throws DomError {
+               public override DomNode? append_child (DomNode new_child) {
                        return this.child_nodes.append_child (new_child);
                }
                public override bool has_child_nodes () {
diff --git a/gxml/NodeList.vala b/gxml/NodeList.vala
index bed02f1..bf55923 100644
--- a/gxml/NodeList.vala
+++ b/gxml/NodeList.vala
@@ -231,11 +231,11 @@ namespace GXml {
                        return this.nodes.index (target);
                }
 
-               internal DomNode? insert_before (DomNode new_child, DomNode? ref_child) throws DomError {
+               internal DomNode? insert_before (DomNode new_child, DomNode? ref_child) {
                        this.nodes.insert_before (this.nodes.find (ref_child), new_child);
                        return new_child;
                }
-               internal DomNode? replace_child (DomNode new_child, DomNode old_child) throws DomError {
+               internal DomNode? replace_child (DomNode new_child, DomNode old_child) {
                        int pos = this.index (old_child);
                        this.remove_child (old_child);
                        this.nodes.insert (new_child, pos);
diff --git a/gxml/Text.vala b/gxml/Text.vala
index 6720ae9..e38000d 100644
--- a/gxml/Text.vala
+++ b/gxml/Text.vala
@@ -74,7 +74,7 @@ namespace GXml {
                 * now, it is not attached to the tree as a sibling to
                 * the first part, as the spec wants.
                 */
-               public Text split_text (ulong offset) throws DomError {
+               public Text split_text (ulong offset) {
                        /* libxml2 doesn't handle this directly, in part because it doesn't
                           allow Text siblings.  Boo! */
                        if (offset < 0 || offset > this.length) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]