[gxml] XAttribute: renamed from GAttribute
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] XAttribute: renamed from GAttribute
- Date: Fri, 5 Jul 2019 05:08:58 +0000 (UTC)
commit b6e8ebb0daa022e9c10981596086d0f25f03abbf
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Jul 4 22:00:08 2019 -0500
XAttribute: renamed from GAttribute
gxml/GXmlDocument.vala | 2 +-
gxml/GXmlElement.vala | 6 +++---
gxml/GXmlNode.vala | 4 ++--
gxml/{GXmlAttribute.vala => XAttribute.vala} | 4 ++--
gxml/{GXmlHashMapAttr.vala => XHashMapAttr.vala} | 20 ++++++++++----------
gxml/meson.build | 4 ++--
6 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/gxml/GXmlDocument.vala b/gxml/GXmlDocument.vala
index 3dad3b4..1800433 100644
--- a/gxml/GXmlDocument.vala
+++ b/gxml/GXmlDocument.vala
@@ -91,7 +91,7 @@ public class GXml.GDocument : GXml.GNode,
return false;
}
// GXml.DomNode
- public override Gee.Map<string,GXml.DomNode> attrs { owned get { return new GHashMapAttr (this,
(Xml.Node*) doc) as Gee.Map<string,GXml.DomNode>; } }
+ public override Gee.Map<string,GXml.DomNode> attrs { owned get { return new XHashMapAttr (this,
(Xml.Node*) doc) as Gee.Map<string,GXml.DomNode>; } }
public override Gee.BidirList<GXml.DomNode> children_nodes { owned get { return new GListChildren (this,
(Xml.Node*) doc) as Gee.BidirList<GXml.DomNode>; } }
public override Gee.List<GXml.Namespace> namespaces { owned get { return new GListNamespaces (this,
doc->get_root_element()) as Gee.List<GXml.Namespace>; } }
public override GXml.DomDocument document { get { return this; } }
diff --git a/gxml/GXmlElement.vala b/gxml/GXmlElement.vala
index 409fa93..451f7f3 100644
--- a/gxml/GXmlElement.vala
+++ b/gxml/GXmlElement.vala
@@ -68,11 +68,11 @@ public class GXml.GElement : GXml.GNonDocumentChildNode,
if (ns == null) return null;
var nsa = _node->has_ns_prop (n,ns->href);
if (nsa == null) return null;
- return new GAttribute (_doc, nsa);
+ return new XAttribute (_doc, nsa);
}
var p = _node->has_prop (n);
if (p == null) return null;
- return new GAttribute (_doc, p);
+ return new XAttribute (_doc, p);
}
public void set_ns_attr (string ns, string aname, string value) {
if (_node == null) return;
@@ -98,7 +98,7 @@ public class GXml.GElement : GXml.GNonDocumentChildNode,
if (_node == null) return null;
var a = _node->has_ns_prop (name, uri);
if (a == null) return null;
- return new GAttribute (_doc, a);
+ return new XAttribute (_doc, a);
}
public new void normalize () {}
public string content {
diff --git a/gxml/GXmlNode.vala b/gxml/GXmlNode.vala
index 8a8a757..0b46ba8 100644
--- a/gxml/GXmlNode.vala
+++ b/gxml/GXmlNode.vala
@@ -56,7 +56,7 @@ public abstract class GXml.GNode : Object,
if (_node == null) return false;
return ((_node->new_ns (uri, prefix)) != null);
}
- public virtual Gee.Map<string,GXml.DomNode> attrs { owned get { return new GHashMapAttr (_doc, _node) as
Gee.Map<string,GXml.DomNode>; } }
+ public virtual Gee.Map<string,GXml.DomNode> attrs { owned get { return new XHashMapAttr (_doc, _node) as
Gee.Map<string,GXml.DomNode>; } }
public virtual Gee.BidirList<GXml.DomNode> children_nodes { owned get { return new GListChildren (_doc,
_node) as Gee.BidirList<GXml.DomNode>; } }
public virtual Gee.List<GXml.Namespace> namespaces { owned get { return new GListNamespaces (_doc, _node)
as Gee.List<GXml.Namespace>; } }
public virtual GXml.DomDocument document { get { return _doc; } }
@@ -100,7 +100,7 @@ public abstract class GXml.GNode : Object,
case GXml.NodeType.ELEMENT:
return new GElement (doc, node);
case GXml.NodeType.ATTRIBUTE:
- return new GAttribute (doc, (Xml.Attr*) node);
+ return new XAttribute (doc, (Xml.Attr*) node);
case GXml.NodeType.TEXT:
return new GText (doc, node);
case GXml.NodeType.ENTITY_REFERENCE:
diff --git a/gxml/GXmlAttribute.vala b/gxml/XAttribute.vala
similarity index 97%
rename from gxml/GXmlAttribute.vala
rename to gxml/XAttribute.vala
index fb34d2d..eb4f155 100644
--- a/gxml/GXmlAttribute.vala
+++ b/gxml/XAttribute.vala
@@ -24,10 +24,10 @@ using Gee;
/**
* Class implemeting {@link GXml.DomAttr} interface, not tied to libxml-2.0 library.
*/
-public class GXml.GAttribute : GXml.GNode, GXml.DomAttr
+public class GXml.XAttribute : GXml.GNode, GXml.DomAttr
{
private Xml.Attr* _attr;
- public GAttribute (GDocument doc, Xml.Attr *node)
+ public XAttribute (GDocument doc, Xml.Attr *node)
{
_attr = node;
_node = _attr->parent;
diff --git a/gxml/GXmlHashMapAttr.vala b/gxml/XHashMapAttr.vala
similarity index 96%
rename from gxml/GXmlHashMapAttr.vala
rename to gxml/XHashMapAttr.vala
index f81b16a..67d89cc 100644
--- a/gxml/GXmlHashMapAttr.vala
+++ b/gxml/XHashMapAttr.vala
@@ -26,24 +26,24 @@ using Gee;
* Implementation of {@link Gee.AbstractMap} to handle {@link Xml.Node} attributes,
* powered by libxml2 library.
*/
-public class GXml.GHashMapAttr : Gee.AbstractMap<string,GXml.GNode>,
+public class GXml.XHashMapAttr : Gee.AbstractMap<string,GXml.GNode>,
GXml.DomNamedNodeMap
{
private GDocument _doc;
private Xml.Node *_node;
- public GHashMapAttr (GDocument doc, Xml.Node *node) {
+ public XHashMapAttr (GDocument doc, Xml.Node *node) {
_node = node;
_doc = doc;
}
-
+
public class Entry : Gee.Map.Entry<string,GXml.GNode> {
private GXml.GDocument _doc;
private Xml.Attr *_attr;
- private GAttribute oattr;
+ private XAttribute oattr;
public Entry (GDocument doc, Xml.Attr *attr) {
_attr = attr;
_doc = doc;
- oattr = new GAttribute (_doc, _attr);
+ oattr = new XAttribute (_doc, _attr);
}
public override string key { get { return _attr->name; } }
public override bool read_only { get { return true; } }
@@ -74,7 +74,7 @@ public class GXml.GHashMapAttr : Gee.AbstractMap<string,GXml.GNode>,
if (ps->name == n) {
if (ps->ns == null) continue;
if (ps->ns->prefix == prefix)
- return new GAttribute (_doc, ps);
+ return new XAttribute (_doc, ps);
}
ps = ps->next;
}
@@ -85,9 +85,9 @@ public class GXml.GHashMapAttr : Gee.AbstractMap<string,GXml.GNode>,
if (p->ns != null) {
var npns = _node->has_ns_prop (key, null);
if (npns != null)
- return new GAttribute (_doc, npns);
+ return new XAttribute (_doc, npns);
}
- return new GAttribute (_doc, p);
+ return new XAttribute (_doc, p);
}
public override bool has (string key, GXml.GNode value) { return has_key (key); }
public override bool has_key (string key) {
@@ -154,7 +154,7 @@ public class GXml.GHashMapAttr : Gee.AbstractMap<string,GXml.GNode>,
var l = new ArrayList<GXml.GNode> ();
var p = _node->properties;
while (p != null) {
- l.add (new GAttribute (_doc, p));
+ l.add (new XAttribute (_doc, p));
p = p->next;
}
return l;
@@ -177,7 +177,7 @@ public class GXml.GHashMapAttr : Gee.AbstractMap<string,GXml.GNode>,
return nullstr;
}
public GXml.GNode get_value () {
- return new GAttribute (_doc, _current);
+ return new XAttribute (_doc, _current);
}
public bool has_next () {
if (_node->properties == null) return false;
diff --git a/gxml/meson.build b/gxml/meson.build
index 5c2ba37..fd66aef 100644
--- a/gxml/meson.build
+++ b/gxml/meson.build
@@ -64,7 +64,6 @@ valasources = files ([
'GomSchema.vala',
'GomStringRef.vala',
'GomText.vala',
- 'GXmlAttribute.vala',
'GXmlCharacter.vala',
'GXmlChildNode.vala',
'GXmlComment.vala',
@@ -73,7 +72,6 @@ valasources = files ([
'GXmlDomEvents.vala',
'GXmlDomRange.vala',
'GXmlElement.vala',
- 'GXmlHashMapAttr.vala',
'gxml-init.vala',
'GXmlListChildren.vala',
'GXmlListNamespaces.vala',
@@ -87,6 +85,8 @@ valasources = files ([
'NodeType.vala',
'Parser.vala',
'Schema.vala',
+ 'XAttribute.vala',
+ 'XHashMapAttr.vala',
'XParser.vala',
'XPath.vala'
])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]