[gxml] Fixes to bug #760568. Some documentation updates



commit cae952514697c96ea5de8703a50133219386c41e
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Apr 20 11:24:08 2016 -0500

    Fixes to bug #760568. Some documentation updates

 gxml/Document.vala           |    3 +++
 gxml/Enumeration.vala        |    3 +++
 gxml/GHtml.vala              |    3 +++
 gxml/GXmlHashMapAttr.vala    |    3 +++
 gxml/GXmlListChildren.vala   |    3 +++
 gxml/GXmlListNamespaces.vala |    3 +++
 gxml/Makefile.am             |    8 ++++++++
 gxml/SerializableEnum.vala   |    5 ++++-
 gxml/SerializableFloat.vala  |    8 +++++++-
 gxml/libxml-Error.vala       |    2 +-
 gxml/xlibxml.c               |   20 ++++++++++----------
 11 files changed, 48 insertions(+), 13 deletions(-)
---
diff --git a/gxml/Document.vala b/gxml/Document.vala
index 4d0d798..7fd87ea 100644
--- a/gxml/Document.vala
+++ b/gxml/Document.vala
@@ -22,6 +22,9 @@
 
 using Gee;
 
+/**
+ * Errors for documents handling reading/writing
+ */
 public errordomain GXml.DocumentError {
   INVALID_DOCUMENT_ERROR,
   INVALID_FILE
diff --git a/gxml/Enumeration.vala b/gxml/Enumeration.vala
index 441d87d..db7ecce 100644
--- a/gxml/Enumeration.vala
+++ b/gxml/Enumeration.vala
@@ -183,6 +183,9 @@ namespace GXml {
                        return s;
                }
        }
+  /**
+   * Errors when de/serializing enumerations.
+   */
        public errordomain EnumerationError
        {
                /**
diff --git a/gxml/GHtml.vala b/gxml/GHtml.vala
index 2ebc560..b8ddc99 100644
--- a/gxml/GHtml.vala
+++ b/gxml/GHtml.vala
@@ -25,6 +25,9 @@
 using Gee;
 
 namespace GXml {
+       /**
+   * HML parsing suport. Document handling
+   */
        public class HtmlDocument : GXml.xDocument {
                public static int default_options {
                        get {
diff --git a/gxml/GXmlHashMapAttr.vala b/gxml/GXmlHashMapAttr.vala
index 54b3cf4..837142e 100644
--- a/gxml/GXmlHashMapAttr.vala
+++ b/gxml/GXmlHashMapAttr.vala
@@ -22,6 +22,9 @@
 
 using Gee;
 
+/**
+ * Implementation of { link Gee.AbstractMap} to handle { link Xml.Node} attributes
+ */
 public class GXml.GHashMapAttr : Gee.AbstractMap<string,GXml.Node>
 {
   private GDocument _doc;
diff --git a/gxml/GXmlListChildren.vala b/gxml/GXmlListChildren.vala
index e062404..072b879 100644
--- a/gxml/GXmlListChildren.vala
+++ b/gxml/GXmlListChildren.vala
@@ -22,6 +22,9 @@
 
 using Gee;
 
+/**
+ * A { link Gee.AbstractBidirList} implementation to access { link Xml.Node} collection
+ */
 public class GXml.GListChildren : AbstractBidirList<GXml.Node>
 {
   private GXml.GDocument _doc;
diff --git a/gxml/GXmlListNamespaces.vala b/gxml/GXmlListNamespaces.vala
index f22d6b6..5ef33d7 100644
--- a/gxml/GXmlListNamespaces.vala
+++ b/gxml/GXmlListNamespaces.vala
@@ -22,6 +22,9 @@
 
 using Gee;
 
+/**
+ * A { link Gee.AbstractList} implementation to access { link Xml.Ns} namespaces collection
+ */
 public class GXml.GListNamespaces : Gee.AbstractList<GXml.Node>
 {
   private GDocument _doc;
diff --git a/gxml/Makefile.am b/gxml/Makefile.am
index 74513cf..f0867be 100644
--- a/gxml/Makefile.am
+++ b/gxml/Makefile.am
@@ -115,6 +115,14 @@ AM_CFLAGS = \
        $(VALA_CFLAGS) \
        $(NULL)
 
+
+if ENABLE_DEVHELP_DOCS
+
+AM_VALAFLAGS += \
+       --vapi-comments
+
+endif
+
 # -Wall   # TODO: add this back when we can properly handle more libxml2/vala warnings
 
 if DEBUG
diff --git a/gxml/SerializableEnum.vala b/gxml/SerializableEnum.vala
index 7d1a292..4589854 100644
--- a/gxml/SerializableEnum.vala
+++ b/gxml/SerializableEnum.vala
@@ -22,6 +22,9 @@
 
 using Gee;
 
+/**
+ * Errors when de/serializing enumerations as a set of string when using { link GXml.SerializableEnum}
+ */
 public errordomain GXml.SerializableEnumError {
   INVALID_VALUE_ERROR,
   PARSE_ERROR
@@ -78,4 +81,4 @@ public class GXml.SerializableEnum : Object, SerializableProperty
   public string get_serializable_property_value () { return _val; }
   public void set_serializable_property_value (string? val) { _val = val; }
   public string to_string () { return _val; }
-}
\ No newline at end of file
+}
diff --git a/gxml/SerializableFloat.vala b/gxml/SerializableFloat.vala
index 6137f7e..4c3f61b 100644
--- a/gxml/SerializableFloat.vala
+++ b/gxml/SerializableFloat.vala
@@ -20,6 +20,12 @@
  *      Daniel Espinosa <esodan gmail com>
  */
 
+/**
+ * Represent any float property to be added as a { link GXml.Attribute} to a { link GXml.Element}
+ *
+ * This object can be used when the property could be removed from serialization, specially if missing
+ * on XML have some missing and avoidable.
+ */
 public class GXml.SerializableFloat : GXml.SerializableDouble
 {
   /**
@@ -36,4 +42,4 @@ public class GXml.SerializableFloat : GXml.SerializableDouble
    * Given float number is parsed to string and then stored.
    */
   public new void set_value (float val) { _val = val.to_string (); }
-}
\ No newline at end of file
+}
diff --git a/gxml/libxml-Error.vala b/gxml/libxml-Error.vala
index b458223..f0b29d3 100644
--- a/gxml/libxml-Error.vala
+++ b/gxml/libxml-Error.vala
@@ -1,6 +1,6 @@
 namespace GXml {
        /**
-        * Errors for parse and writer.
+        * libmxl2 bindings for Errors on parse and write.
         */
        public errordomain Error {
                NOT_SUPPORTED, /* TODO: GET RID OF THIS */
diff --git a/gxml/xlibxml.c b/gxml/xlibxml.c
index 2f57eaa..c9c52ba 100644
--- a/gxml/xlibxml.c
+++ b/gxml/xlibxml.c
@@ -29,7 +29,7 @@ void* gxml_doc_get_intsubset_entities (xmlDoc *doc)
 
 gint gxml_validate_name (xmlChar* name, int space)
 {
-  g_return_if_fail (name != NULL);
+  g_return_val_if_fail (name != NULL, -1);
   return xmlValidateName (name, space);
 }
 
@@ -65,35 +65,35 @@ void gxml_reset_last_error ()
 
 xmlNsPtr* gxml_doc_get_ns_list (xmlDoc* doc, xmlNode* node)
 {
-  g_return_if_fail (doc != NULL);
-  g_return_if_fail (node != NULL);
+  g_return_val_if_fail (doc != NULL, NULL);
+  g_return_val_if_fail (node != NULL, NULL);
   return xmlGetNsList (doc, node);
 }
 
 xmlTextWriterPtr gxml_new_text_writer_doc (xmlDoc** doc)
 {
-  g_return_if_fail (doc != NULL);
+  g_return_val_if_fail (doc != NULL, NULL);
   return xmlNewTextWriterDoc (doc, 0);
 }
 
 xmlTextWriterPtr gxml_new_text_writer_memory (xmlBufferPtr buffer, gint compression)
 {
-  g_return_if_fail (buffer != NULL);
+  g_return_val_if_fail (buffer != NULL, NULL);
   return xmlNewTextWriterMemory (buffer, compression);
 }
 
 gint gxml_text_writer_write_cdata (xmlTextWriterPtr tw, const xmlChar* text)
 {
-  g_return_if_fail (tw != NULL);
-  g_return_if_fail (text != NULL);
+  g_return_val_if_fail (tw != NULL, -1);
+  g_return_val_if_fail (text != NULL, -1);
   return xmlTextWriterWriteCDATA (tw, text);
 }
 
 gint gxml_text_writer_write_pi (xmlTextWriterPtr tw, const xmlChar* target, const xmlChar* data)
 {
-  g_return_if_fail (tw != NULL);
-  g_return_if_fail (target != NULL);
-  g_return_if_fail (data != NULL);
+  g_return_val_if_fail (tw != NULL, -1);
+  g_return_val_if_fail (target != NULL, -1);
+  g_return_val_if_fail (data != NULL, -1);
   return xmlTextWriterWritePI (tw, target, data);
 }
 


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