[gxml] * add documentation for CharacterData
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] * add documentation for CharacterData
- Date: Thu, 21 Jul 2011 19:47:36 +0000 (UTC)
commit a6026af6fb7384b7bc72dad8b1855230bf06ccc8
Author: Richard Schwarting <aquarichy gmail com>
Date: Thu Jul 21 14:36:56 2011 -0400
* add documentation for CharacterData
gxml/CharacterData.vala | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
---
diff --git a/gxml/CharacterData.vala b/gxml/CharacterData.vala
index 66e6073..1803c17 100644
--- a/gxml/CharacterData.vala
+++ b/gxml/CharacterData.vala
@@ -1,7 +1,15 @@
/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
namespace GXml.Dom {
+ /**
+ * CharacterData defines an interface for manipulating XML character data. It is used by
+ * the CDATASection, Text, and Comment node types. For more, see: [[http://www.w3.org/TR/DOM-Level-1/level-one-core.html#ID-FF21A306]]
+ */
public class CharacterData : BackedNode {
+ /**
+ * The character data in string form for the node.
+ * Generally equivalent to node_value.
+ */
public string data {
get {
return this.node_value;
@@ -11,6 +19,9 @@ namespace GXml.Dom {
this.node_value = value;
}
}
+ /**
+ * The number of characters.
+ */
public ulong length {
get {
return data.length;
@@ -23,23 +34,38 @@ namespace GXml.Dom {
base (char_node, doc);
// TODO: if this was this (), it would recurse infinitely, maybe valac could detect that
}
-
+ /**
+ * Retrieves a substring of the character data
+ * count-characters long, starting from the character
+ * at offset.
+ */
public string substring_data (ulong offset, ulong count) { // throws DomError
// TODO: handle out of bounds
return this.data.substring ((long)offset, (long)count);
}
-
+ /**
+ * Appends arg to the end of the character data.
+ */
public void append_data (string arg) /* throws DomError */ {
this.data = this.data.concat (arg);
}
+ /**
+ * Inserts arg into the character data at offset.
+ */
public void insert_data (ulong offset, string arg) /* throws DomError */ {
// TODO: complain about boundaries
this.data = this.data.substring (0, (long)offset).concat (arg, this.data.substring ((long)offset));
-
}
+ /**
+ * Deletes a range of characters, count-characters long, starting from offset.
+ */
public void delete_data (ulong offset, ulong count) /* throws DomError */ {
this.data = this.data.substring (0, (long)offset).concat (this.data.substring ((long)(offset + count)));
}
+ /**
+ * Replaces a range of characters, count-characters
+ * long, starting at offset, with arg.
+ */
public void replace_data (ulong offset, ulong count, string arg) /* throws DomError */ {
// TODO: bounds
this.data = this.data.substring (0, (long)offset).concat (arg, this.data.substring ((long)(offset + count)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]