[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenonbeta/kdom/patternist/data
From: Frans Englich <frans.englich () telia ! com>
Date: 2006-07-04 22:52:47
Message-ID: 1152053567.156675.4092.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 558240 by englich:
More tinkering.
M +89 -0 Node.h
--- trunk/kdenonbeta/kdom/patternist/data/Node.h #558239:558240
@@ -51,6 +51,80 @@
};
/**
+ * Identify different axes. An axis navigates from a node in a way specific to that axis.
+ *
+ * The axes Child, Descendant, Attribute, Self, DescendantOrSelf, FollowingSibling,
+ * and Following are forward axes, while Parent, Ancestor, PrecedingSibling,
+ * Preceding and AncestorOrSelf are reverse axes.
+ *
+ * @see iterate()
+ */
+ enum Axis
+ {
+ /**
+ * The <tt>child</tt> axis.
+ */
+ Child = 1,
+
+ /**
+ * The <tt>descendant</tt> axis.
+ */
+ Descendant = 2,
+
+ /**
+ * The <tt>attribute</tt> axis. This enum value isn't named
+ * "Attribute", in order to not clash with the Attribute node kind.
+ */
+ AttributeAxis = 4,
+
+ /**
+ * The <tt>self</tt> axis.
+ */
+ Self = 8,
+
+ /**
+ * The <tt>descendant-or-self</tt> axis.
+ */
+ DescendantOrSelf = 16,
+
+ /**
+ * The <tt>following-sibling</tt> axis.
+ */
+ FollowingSibling = 32,
+
+ /**
+ * The <tt>following</tt> axis.
+ */
+ Following = 64,
+
+ /**
+ * The <tt>parent</tt> axis.
+ */
+ Parent = 128,
+
+ /**
+ * The <tt>ancestor</tt> axis.
+ */
+ Ancestor = 256,
+
+ /**
+ * The <tt>preceding-sibling</tt> axis.
+ */
+ PrecedingSibling = 512,
+
+ /**
+ * The <tt>preceding</tt> axis.
+ */
+ Preceding = 1024,
+
+ /**
+ * The <tt>ancestor-or-self</tt> axis.
+ */
+ AncestorOrSelf = 2048
+ };
+ typedef QFlags<Axis> Axes;
+
+ /**
* A smart pointer wrapping Node instances.
*/
typedef KDOM::PlainSharedPtr<Node> Ptr;
@@ -73,6 +147,21 @@
virtual KDOM::SharedQName::Ptr name() const = 0;
/**
+ * Returns the parent Node of this Node.
+ *
+ * This function maps to the <tt>dm:parent()</tt> accessor.
+ *
+ * @see <a href="http://www.w3.org/TR/xpath-datamodel/#dm-parent">XQuery 1.0
+ * and XPath 2.0 Data Model (XDM), 5.12 parent Accessor</a>
+ * @returns the parent or @c null if this Node is parentless.
+ */
+ virtual Node::Ptr parent() const = 0;
+
+ /**
+ */
+ virtual Item::Iterator::Ptr iterate(const Axis axis) const;
+
+ /**
* Returns an integer that uniquely identifies this node. For every node, this
* identifier is guaranteed to be unique.
*
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic