[gxml] * change from NameTagNodeList to TagNameNodeList
- From: Richard Hans Schwarting <rschwart src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] * change from NameTagNodeList to TagNameNodeList
- Date: Fri, 29 Jul 2011 02:13:27 +0000 (UTC)
commit 21d01d6e5a7b102472004167be2e82d1a61a0602
Author: Richard Schwarting <aquarichy gmail com>
Date: Thu Jul 28 15:39:06 2011 -0400
* change from NameTagNodeList to TagNameNodeList
gxml/Element.vala | 11 ++++++-----
gxml/NodeList.vala | 8 ++++----
2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/gxml/Element.vala b/gxml/Element.vala
index feec04a..3157124 100644
--- a/gxml/Element.vala
+++ b/gxml/Element.vala
@@ -192,7 +192,7 @@ namespace GXml.Dom {
return old_attr;
}
- /*** XNode methods ***/
+ // TODO: consider making the life of TagNameNodeLists optional, and dead by default, at the Document level
private void check_add_tag_name (Element basenode, XNode child) {
// TODO: make sure there aren't any other NodeTypes that could have elements as children
if (child.node_type == NodeType.ELEMENT || child.node_type == NodeType.DOCUMENT_FRAGMENT) {
@@ -220,6 +220,7 @@ namespace GXml.Dom {
}
}
+ /*** XNode methods ***/
public override XNode? insert_before (XNode new_child, XNode? ref_child) throws DomError {
XNode ret = base.insert_before (new_child, ref_child);
check_add_tag_name (this, new_child);
@@ -269,11 +270,11 @@ namespace GXml.Dom {
see a, add a, visit a
*/
- private List<NameTagNodeList> tag_name_lists = new List<NameTagNodeList> ();
+ private List<TagNameNodeList> tag_name_lists = new List<TagNameNodeList> ();
private void on_new_descendant_with_tag_name (Element elem) {
// TODO: consider using a HashTable instead
- foreach (NameTagNodeList list in tag_name_lists) {
+ foreach (TagNameNodeList list in tag_name_lists) {
// TODO: take into account case sensitivity or insensitivity?
if (elem.tag_name == list.tag_name) {
list.append_child (elem);
@@ -284,7 +285,7 @@ namespace GXml.Dom {
((Element)this.parent_node).on_new_descendant_with_tag_name (elem);
}
private void on_remove_descendant_with_tag_name (Element elem) {
- foreach (NameTagNodeList list in tag_name_lists) {
+ foreach (TagNameNodeList list in tag_name_lists) {
if (elem.tag_name == list.tag_name) {
foreach (XNode tag_elem in list) {
if (((Element)tag_elem) == elem) {
@@ -314,7 +315,7 @@ namespace GXml.Dom {
* element, I think probably not.
*/
public NodeList get_elements_by_tag_name (string tag_name) {
- NameTagNodeList tagged = new NameTagNodeList (tag_name, this, this.owner_document);
+ TagNameNodeList tagged = new TagNameNodeList (tag_name, this, this.owner_document);
//List<XNode> tagged = new List<XNode> ();
Queue<Xml.Node*> tocheck = new Queue<Xml.Node*> ();
diff --git a/gxml/NodeList.vala b/gxml/NodeList.vala
index 3ad9e71..84bd2bf 100644
--- a/gxml/NodeList.vala
+++ b/gxml/NodeList.vala
@@ -92,12 +92,12 @@ namespace GXml.Dom {
}
// TODO: this will somehow need to watch the document and find out as new elements are added, and get reconstructed each time, or get reconstructed-on-the-go?
- internal class NameTagNodeList : Gee.Iterable<XNode>, NodeList, GLib.Object {
+ internal class TagNameNodeList : Gee.Iterable<XNode>, NodeList, GLib.Object {
internal string tag_name;
internal XNode root;
internal GLib.List<XNode> nodes;
- internal NameTagNodeList (string tag_name, XNode root, Document owner) {
+ internal TagNameNodeList (string tag_name, XNode root, Document owner) {
this.tag_name = tag_name;
this.root = root;
this.nodes = new GLib.List<XNode> ();
@@ -219,12 +219,12 @@ namespace GXml.Dom {
return new NodeListIterator (this);
}
private class NodeListIterator : Gee.Iterator<XNode>, GLib.Object {
- private NameTagNodeList list;
+ private TagNameNodeList list;
private unowned GLib.List<XNode> nodes;
private unowned GLib.List<XNode> cur;
private unowned GLib.List<XNode> next_node;
- public NodeListIterator (NameTagNodeList list) {
+ public NodeListIterator (TagNameNodeList list) {
this.list = list;
this.nodes = list.nodes;
this.next_node = this.nodes;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]