ITK
5.2.0
Insight Toolkit
|
#include <itkDOMNode.h>
Public Types | |
using | AttributeItemType = std::pair< const AttributeKeyType, AttributeValueType > |
using | AttributeKeyType = std::string |
using | AttributesListType = std::list< AttributeItemType > |
using | AttributeValueType = std::string |
using | ChildrenListType = std::vector< DOMNode * > |
using | ConstChildrenListType = std::vector< const DOMNode * > |
using | ConstPointer = SmartPointer< const Self > |
using | IdentifierType = int |
using | OffsetType = int |
using | Pointer = SmartPointer< Self > |
using | Self = DOMNode |
using | SizeType = std::vcl_size_t |
using | Superclass = Object |
Public Types inherited from itk::Object | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = Object |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
virtual const char * | GetNameOfClass () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
using | ChildrenContainer = std::vector< Pointer > |
using | AttributesContainer = std::map< AttributeKeyType, AttributeValueType > |
using | OrderedAttributesContainer = std::list< AttributeItemType * > |
DOMNode * | m_Parent { nullptr } |
std::string | m_Name |
std::string | m_ID |
ChildrenContainer | m_Children |
AttributesContainer | m_Attributes |
OrderedAttributesContainer | m_OrderedAttributes |
virtual void | SetParent (DOMNode *node) |
DOMNode * | GetParent () |
const DOMNode * | GetParent () const |
virtual void | SetName (std::string &_arg) |
virtual const std::string & | GetName () const |
virtual void | SetID (std::string &_arg) |
virtual const std::string & | GetID () const |
virtual std::string | GetAttribute (const std::string &key) const |
virtual bool | HasAttribute (const std::string &key) const |
virtual void | SetAttribute (const std::string &key, const std::string &value) |
virtual void | RemoveAttribute (const std::string &key) |
virtual void | GetAllAttributes (AttributesListType &output, bool keepOriginalOrder=true) const |
virtual void | RemoveAllAttributes () |
virtual SizeType | GetNumberOfChildren () const |
virtual void | GetAllChildren (ChildrenListType &output) |
virtual void | GetAllChildren (ConstChildrenListType &output) const |
virtual void | GetChildren (const std::string &tag, ChildrenListType &output) |
virtual void | GetChildren (const std::string &tag, ConstChildrenListType &output) const |
virtual void | RemoveAllChildren () |
virtual void | AddChild (DOMNode *node, IdentifierType i=0) |
virtual void | AddChildAtBegin (DOMNode *node) |
virtual void | AddChildAtEnd (DOMNode *node) |
virtual void | SetChild (DOMNode *node, IdentifierType i=0) |
virtual void | RemoveChild (IdentifierType i=0) |
virtual void | RemoveAllAttributesAndChildren () |
virtual DOMNode * | GetChild (IdentifierType i=0) |
virtual const DOMNode * | GetChild (IdentifierType i=0) const |
virtual DOMNode * | GetChild (const std::string &tag, IdentifierType i=0) |
virtual const DOMNode * | GetChild (const std::string &tag, IdentifierType i=0) const |
virtual DOMNode * | GetChildByID (const std::string &value) |
virtual const DOMNode * | GetChildByID (const std::string &value) const |
virtual DOMNode * | GetSibling (OffsetType i) |
virtual const DOMNode * | GetSibling (OffsetType i) const |
virtual DOMNode * | GetRoot () |
virtual const DOMNode * | GetRoot () const |
virtual bool | ShareRoot (const DOMNode *node) const |
virtual DOMNode * | Find (const std::string &path) |
virtual const DOMNode * | Find (const std::string &path) const |
virtual std::string | GetPath () const |
virtual DOMTextNode * | GetTextChild (IdentifierType i=0) |
virtual const DOMTextNode * | GetTextChild (IdentifierType i=0) const |
virtual void | AddTextChild (const std::string &text, IdentifierType i=0) |
virtual void | AddTextChildAtBegin (const std::string &text) |
virtual void | AddTextChildAtEnd (const std::string &text) |
virtual void | SetTextChild (const std::string &text, IdentifierType i=0) |
DOMNode () | |
Additional Inherited Members | |
Protected Member Functions inherited from itk::Object | |
Object () | |
~Object () override | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
Class to represent a node in a Document Object Model (DOM) tree structure.
A DOM is a structured document representation, in our case parsed from an XML stream (i.e. a file or a string). It is a tree structure in which each node has links to its children nodes and to its parent node (if it is not the root). This class serves as a base node corresponding to an XML tag that only contains attributes (no content for the tag itself).
Definition at line 53 of file itkDOMNode.h.
using itk::DOMNode::AttributeItemType = std::pair<const AttributeKeyType, AttributeValueType> |
Definition at line 78 of file itkDOMNode.h.
using itk::DOMNode::AttributeKeyType = std::string |
An attribute is a pair of <key,value>, both key and value are strings.
Definition at line 75 of file itkDOMNode.h.
|
private |
Internally the attributes are stored in a map.
Definition at line 289 of file itkDOMNode.h.
using itk::DOMNode::AttributesListType = std::list<AttributeItemType> |
Container to return the attributes of a DOM node.
Definition at line 81 of file itkDOMNode.h.
using itk::DOMNode::AttributeValueType = std::string |
Definition at line 76 of file itkDOMNode.h.
|
private |
Internally the children are stored in a vector.
Definition at line 285 of file itkDOMNode.h.
using itk::DOMNode::ChildrenListType = std::vector<DOMNode *> |
Container to return all or a subset of the children of a DOM node.
Definition at line 71 of file itkDOMNode.h.
using itk::DOMNode::ConstChildrenListType = std::vector<const DOMNode *> |
Definition at line 72 of file itkDOMNode.h.
using itk::DOMNode::ConstPointer = SmartPointer<const Self> |
Definition at line 62 of file itkDOMNode.h.
using itk::DOMNode::IdentifierType = int |
Definition at line 84 of file itkDOMNode.h.
using itk::DOMNode::OffsetType = int |
Definition at line 85 of file itkDOMNode.h.
|
private |
Container to keep the inserting orders of the attributes.
Definition at line 293 of file itkDOMNode.h.
using itk::DOMNode::Pointer = SmartPointer<Self> |
Definition at line 61 of file itkDOMNode.h.
using itk::DOMNode::Self = DOMNode |
Standard class type aliases.
Definition at line 59 of file itkDOMNode.h.
using itk::DOMNode::SizeType = std::vcl_size_t |
Definition at line 83 of file itkDOMNode.h.
using itk::DOMNode::Superclass = Object |
Definition at line 60 of file itkDOMNode.h.
|
protected |
Internally the children are stored in a vector.
|
virtual |
Add a child in front of another child (throw exception if not able to add).
|
virtual |
Add a child in front of the children list (throw exception if not able to add).
|
virtual |
Add a child at the end of the children list (throw exception if not able to add).
|
virtual |
Generate a text node from a string and add/insert it as a child (see AddChild(node,i)).
|
virtual |
Generate a text node from a string and add/insert in front of all children.
|
virtual |
Generate a text node from a string and add/insert at the end of all children.
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::Object.
Reimplemented in itk::DOMTextNode.
|
virtual |
The following function finds a child or sibling or relative using a query string or path. A path or QueryString consists of multiple following items that are separated by '/':
* -[n] : an older sibling by distance 1 (when omitted) or n; * +[n] : a younger sibling by distance 1 (when omitted) or n; * n : a child at index n; * <tag>[:n] : a child at index 0 (when omitted) or n after filtering children with a tag name; * ![:n] : a child at index 0 (when omitted) or n within all text children; * :<id> : a child by id; * . : current node; * .. : parent node; * /<rpath> : absolute path (denote apath), search from the root. *
The method returns nullptr if queried node does not exist.
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Return all attributes, in the order of being parsed or added (default), or alphabetic order of the attribute keys (keepOriginalOrder = false).
|
virtual |
Return all children.
|
virtual |
Return all children for read-only access.
|
virtual |
Retrieve an attribute by key (return an empty string if not found).
|
virtual |
Retrieve a child by tag name and an index (multiple children can have a same tag name, return nullptr if no such child).
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Retrieve a child by index (return nullptr if i is out of range).
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Retrieve a child by its unique "id" attribute value (return nullptr if not found).
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Return all children of a same tag name.
|
virtual |
Return all children of a same tag name for read-only access.
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::Object.
Reimplemented in itk::DOMTextNode.
|
virtual |
Get number of children.
DOMNode* itk::DOMNode::GetParent | ( | ) |
Internally the children are stored in a vector.
const DOMNode* itk::DOMNode::GetParent | ( | ) | const |
Internally the children are stored in a vector.
|
virtual |
Return the path of this node within its root, in the form of a query string that uses only indices.
|
virtual |
Return the root node.
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Retrieve an older or younger sibling by distance (return nullptr if no such sibling).
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Get a child and cast it to a text node (return nullptr if out of range or not a text node).
|
virtual |
Internally the children are stored in a vector.
|
virtual |
Check whether has an attribute.
|
static |
Method for creation through the object factory.
|
virtual |
Remove all attributes.
|
virtual |
Remove all attributes and children.
|
virtual |
Remove all children.
|
virtual |
Remove an attribute by key (throw exception if not found).
|
virtual |
Remove a child by index (throw exception if not able to remove).
|
virtual |
Add or replace an attribute.
|
virtual |
Replace a child (throw exception if not able to replace).
|
virtual |
Retrieve the special attribute "id" of this node.
|
virtual |
Retrieve the tag name of this node.
Referenced by itk::DOMTextNode::DOMTextNode().
|
virtual |
Retrieve the parent node.
|
virtual |
Generate a text node from a string and replace a child with it (see SetChild(node,i).
|
virtual |
Test whether the input node and this node share the same root.
|
private |
Internally the children are stored in a vector.
Definition at line 290 of file itkDOMNode.h.
|
private |
Internally the children are stored in a vector.
Definition at line 286 of file itkDOMNode.h.
|
private |
The special attribute "id" of this node.
Definition at line 282 of file itkDOMNode.h.
|
private |
The XML tag of this node.
Definition at line 279 of file itkDOMNode.h.
|
private |
Internally the children are stored in a vector.
Definition at line 294 of file itkDOMNode.h.
|
private |
The parent node that this node was placed into.
Definition at line 276 of file itkDOMNode.h.