| XMP Toolkit SDK 6.0.0

Public Member Functions | List of all members
AdobeXMPCore::ICompositeNode_v1 Class Referenceabstract

Version1 of the interface that serves as a base interface to all composite types of nodes in the XMP DOM ( like Arrays and Structures ). More...

`#include <ICompositeNode.h>`

Inheritance diagram for AdobeXMPCore::ICompositeNode_v1:

## Public Member Functions
virtual eNodeType APICALL | GetNodeTypeAtPath (const spcIPath &path) const =0
| Get the node type specified by the path relative to the composite node. More...
virtual void APICALL | AppendNode (const spINode &node)=0
| Appends a given node as the child of the node. More...
virtual void APICALL | InsertNodeAtPath (const spINode &node, const spcIPath &path)=0
| Inserts a given node at the path relative to the composite node. More...
virtual spINode APICALL | ReplaceNodeAtPath (const spINode &node, const spcIPath &path)=0
| Replaces an existing node with the given node at the path relative to the composite node.. More...
virtual spINode APICALL | RemoveNodeAtPath (const spcIPath &path)=0
| Removes the node specified by the path relative to the composite node. More...
XMP_PRIVATE spcINode | GetNodeAtPath (const spcIPath &path) const
| Get the node specified by the path relative to the composite node. More...
virtual spINode APICALL | GetNodeAtPath (const spcIPath &path)=0
virtual spINodeIterator APICALL | Iterator ()=0
| Get an iterator object to iterate over all the child nodes of the composite node. More...
XMP_PRIVATE spcINodeIterator | Iterator () const
virtual sizet APICALL | ChildCount () const __NOTHROW__=0
| Get the count of child nodes of the composite node. More...
XMP_PRIVATE spcISimpleNode | GetSimpleNodeAtPath (const spcIPath &path) const
| Get a simple node specified by the path relative to the node. More...
XMP_PRIVATE spISimpleNode | GetSimpleNodeAtPath (const spcIPath &path)
Public Member Functions inherited from AdobeXMPCore::INode_v1
virtual eNodeType APICALL | GetNodeType () const =0
| Gets the node type of the node. More...
virtual eNodeType APICALL | GetParentNodeType () const =0
| Gets the node type of the node's parent. More...
virtual void APICALL | SetName (const char *name, sizet nameLength)=0
| Changes the local name of the node. More...
virtual spcIUTF8String APICALL | GetName () const =0
| Gets the local name of the node. More...
virtual void APICALL | SetNameSpace (const char *nameSpace, sizet nameSpaceLength)=0
| Changes the name space of the node. More...
virtual spcIUTF8String APICALL | GetNameSpace () const =0
| Gets the name space of the node. More...
virtual spIPath APICALL | GetPath () const =0
| Gets the path of the node from the root of the metadata. More...
virtual sizet APICALL | QualifiersCount () const __NOTHROW__=0
| Gets the count of the qualifiers attached with the node. More...
virtual eNodeType APICALL | GetQualifierNodeType (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength) const =0
| Gets the type of the node's qualifier having specified namespace and name. More...
virtual void APICALL | InsertQualifier (const spINode &node)=0
| Inserts a given qualifier node. More...
virtual spINode APICALL | ReplaceQualifier (const spINode &node)=0
| Replaces a given qualifier node. More...
virtual spINode APICALL | RemoveQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength)=0
| Removes the qualifier node with the specified nameSpace and name. More...
virtual bool APICALL | IsArrayItem () const =0
| Indicates whether the node is a direct child of an array node. More...
virtual bool APICALL | IsQualifierNode () const =0
| Indicates whether the node is a qualifier node. More...
virtual sizet APICALL | GetIndex () const =0
| Returns the index of the node in case it is an array item. More...
virtual bool APICALL | HasQualifiers () const =0
| Indicates whether the node has any qualifiers associated with it. More...
virtual bool APICALL | HasContent () const =0
| Returns whether the node has any content or not. return A bool value indicating the presence of contents in the node apart from qualifiers. More...
virtual bool APICALL | IsEmpty () const =0
| Returns whether the node is empty. return A bool value indicating whether the contents and qualifiers of a node are empty. More...
virtual bool APICALL | HasChanged () const =0
| Returns the status about any change done to the node or its children or qualifiers. returns a bool value indicating whether some changes have been performed on the node or its children or qualifiers. for a simple node, true will be returned in scenarios like when the node's value or qualifiers are modified. for an array node or a structure node, true will be returned in scenarios like when the node's children or the node's qualifiers are modified. More...
virtual void APICALL | AcknowledgeChanges () const __NOTHROW__=0
| Acknowledges that changes for the node and its children and qualifiers have been taken care of. for a simple node, changes that will be acknowledged in scenarios like when the node's value or node's qualifiers were modified. for an array node or a structure node, changes will be acknowledged in scenarios like when the node's children were or the node's qualifiers were modified. More...
virtual void APICALL | Clear (bool contents=true, bool qualifiers=true)=0
| Clear the contents of the node. More...
virtual spINode APICALL | Clone (bool ignoreEmptyNodes=false, bool ignoreNodesWithOnlyQualifiers=false) const =0
| Virtual copy constructor. More...
XMP_PRIVATE spcINode | GetParent () const
| Gets the parent node of the node. More...
virtual spINode APICALL | GetParent ()=0
XMP_PRIVATE spcINodeIterator | QualifiersIterator () const
virtual spINodeIterator APICALL | QualifiersIterator ()=0
XMP_PRIVATE spcINode | GetQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength) const
| Gets the qualifier of the node having specified namespace and name. More...
virtual spINode APICALL | GetQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength)=0
XMP_PRIVATE spcISimpleNode | GetSimpleQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength) const
| Get the node's qualifier having specified name space and name as simple node. More...
XMP_PRIVATE spISimpleNode | GetSimpleQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength)
XMP_PRIVATE spcIStructureNode | GetStructureQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength) const
| Get the node's qualifier having specified name space and name as structure node. More...
XMP_PRIVATE spIStructureNode | GetStructureQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength)
XMP_PRIVATE spcIArrayNode | GetArrayQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength) const
| Get the node's qualifier having specified name space and name as an array node. More...
XMP_PRIVATE spIArrayNode | GetArrayQualifier (const char *nameSpace, sizet nameSpaceLength, const char *name, sizet nameLength)
XMP_PRIVATE spcISimpleNode | ConvertToSimpleNode () const
| Converts Node to a simple node, if possible. More...
virtual spISimpleNode APICALL | ConvertToSimpleNode ()=0
XMP_PRIVATE spcIStructureNode | ConvertToStructureNode () const
| Converts Node to a structure node type, if possible. More...
virtual spIStructureNode APICALL | ConvertToStructureNode ()=0
XMP_PRIVATE spcIArrayNode | ConvertToArrayNode () const
| Converts Node to an array node type, if possible. More...
virtual spIArrayNode APICALL | ConvertToArrayNode ()=0
XMP_PRIVATE spcIMetadata | ConvertToMetadata () const
| Converts Node to a metadata node type, if possible. More...
virtual spIMetadata APICALL | ConvertToMetadata ()=0
Public Member Functions inherited from AdobeXMPCommon::ISharedObject
virtual void APICALL | Acquire () const __NOTHROW__=0
| Called by the clients of the object to indicate that he has acquired the shared ownership of the object. More...
virtual void APICALL | Release () const __NOTHROW__=0
| Called by the clients of the object to indicate he has released his shared ownership of the object. If this being the last client than this function should call Destroy to delete and release the memory. More...
Public Member Functions inherited from AdobeXMPCommon::IVersionable
template<typename requestedInterface >
XMP_PRIVATE requestedInterface * | GetInterfacePointer ()
| Get the raw pointer to an interface object implementing the requested version. More...
template<typename requestedInterface >
const XMP_PRIVATE requestedInterface * | GetInterfacePointer () const
| Get the raw pointer to a const interface object implementing the requested version. More...
Public Member Functions inherited from AdobeXMPCommon::IThreadSafe
virtual void APICALL | EnableThreadSafety () const __NOTHROW__=0
| Enables the thread safety on an object. More...
virtual void APICALL | DisableThreadSafety () const __NOTHROW__=0
| Disables the thread safety on an object. More...
virtual bool APICALL | IsThreadSafe () const =0
| Informs whether object can be used across multiple threads or not. More...
XMP_PRIVATE spcIStructureNode | GetStructureNodeAtPath (const spcIPath &path) const
| Get a structure node specified by the path relative to the node. More...
XMP_PRIVATE spIStructureNode | GetStructureNodeAtPath (const spcIPath &path)
XMP_PRIVATE spcIArrayNode | GetArrayNodeAtPath (const spcIPath &path) const
| Get an array node specified by the path relative to the node. More...
XMP_PRIVATE spIArrayNode | GetArrayNodeAtPath (const spcIPath &path)
virtual | ~ICompositeNode_v1 () __NOTHROW__

## Additional Inherited Members
Public Types inherited from AdobeXMPCore::INode_v1
enum | eNodeType { kNTNone = 0, kNTSimple = 1, kNTArray = 1 << 1, kNTStructure = 1 << 2, kNTAll = kAllBits }
| Indicates various types of node available in XMP Data Model like simple, array and structure. More...
Protected Member Functions inherited from AdobeXMPCore::INode_v1
virtual | ~INode_v1 () __NOTHROW__
Protected Member Functions inherited from AdobeXMPCommon::ISharedObject
virtual | ~ISharedObject () __NOTHROW__=0
| REQ_FRIEND_CLASS_DECLARATION ()
Protected Member Functions inherited from AdobeXMPCommon::IVersionable
virtual | ~IVersionable ()
| REQ_FRIEND_CLASS_DECLARATION ()
Protected Member Functions inherited from AdobeXMPCommon::IThreadSafe
| REQ_FRIEND_CLASS_DECLARATION ()

## Detailed Description

Version1 of the interface that serves as a base interface to all composite types of nodes in the XMP DOM ( like Arrays and Structures ).

Provides all the functions to get various properties of the composite node.

Attention
  Support multi threading through locks but can be enabled/disabled by the client. By default every object created does not support multi-threading.

Definition at line 27 of file ICompositeNode.h.

## Constructor & Destructor Documentation

## ◆ ~ICompositeNode_v1()

virtual AdobeXMPCore::ICompositeNode_v1::~ICompositeNode_v1 | ( |  | ) |
| inline protected virtual

Destructor

Definition at line 259 of file ICompositeNode.h.

259 {}

## Member Function Documentation

## ◆ AppendNode()

virtual void APICALL AdobeXMPCore::ICompositeNode_v1::AppendNode | ( | const spINode & | node | ) |
| pure virtual

Appends a given node as the child of the node.

In case of array node it is appended at the last and in case of structure node qualified name of the node to be inserted determines its position.

Parameters

  [in] | node | Shared pointer to an object of #AdobeXMPCore::INode containing the node to be appended as the last child.

Note
  This operation is not currently implemented for the ICompositeNode interface.

Attention
  Error is thrown in following cases:
  1. provided node is invalid.
  2. type of given node is not same as other child items of the array node.
  3. given node is already a child of some other node.
  4. composite node already has a child node with the same qualified name in case of structure node.

## ◆ ChildCount()

virtual sizet APICALL AdobeXMPCore::ICompositeNode_v1::ChildCount | ( |  | ) | const
| pure virtual

Get the count of child nodes of the composite node.

Returns
  an object of type #AdobeXMPCommon::sizet containing the count of children of the node.

## ◆ GetArrayNodeAtPath() [1/2]

XMP_PRIVATE spIArrayNode AdobeXMPCore::ICompositeNode_v1::GetArrayNodeAtPath | ( | const spcIPath & | path | ) |
| inline

Definition at line 193 of file ICompositeNode.h.

193 {
194 auto node = GetNodeAtPath( path );
195 if ( node ) return node->ConvertToArrayNode();
196 return spIArrayNode();
197 }

## ◆ GetArrayNodeAtPath() [2/2]

XMP_PRIVATE spcIArrayNode AdobeXMPCore::ICompositeNode_v1::GetArrayNodeAtPath | ( | const spcIPath & | path | ) | const
| inline

Get an array node specified by the path relative to the node.

Parameters

  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path from the node to the node client is interested in.

Returns
  A shared pointer to const or non const #IArrayNode object containing node.

Note
  In case no node exists at the given path an invalid shared pointer is returned.

Attention
  Error is thrown in case
  - a node exists at the given path but is not an array node.

Definition at line 187 of file ICompositeNode.h.

187 {
188 auto node = GetNodeAtPath( path );
189 if ( node ) return node->ConvertToArrayNode();
190 return spcIArrayNode();
191 }

## ◆ GetNodeAtPath() [1/2]

XMP_PRIVATE spcINode AdobeXMPCore::ICompositeNode_v1::GetNodeAtPath | ( | const spcIPath & | path | ) | const
| inline

Get the node specified by the path relative to the composite node.

Parameters

  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path from the node to the node client is interested in.

Returns
  A shared pointer to either a const or non const #AdobeXMPCore::INode object containing node.

Note
  In case no node exists at the given path an invalid shared pointer is returned.

Definition at line 49 of file ICompositeNode.h.

49 {
50 return const_cast< ICompositeNode_v1 * >( this )->GetNodeAtPath( path );
51 }

## ◆ GetNodeAtPath() [2/2]

virtual spINode APICALL AdobeXMPCore::ICompositeNode_v1::GetNodeAtPath | ( | const spcIPath & | path | ) |
| pure virtual

## ◆ GetNodeTypeAtPath()

virtual eNodeType APICALL AdobeXMPCore::ICompositeNode_v1::GetNodeTypeAtPath | ( | const spcIPath & | path | ) | const
| pure virtual

Get the node type specified by the path relative to the composite node.

Parameters

  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path from the node to the node client is interested in.

Returns
  The type of the node.

Note
  In case no node exists at the given path a value #eNodeType::kNTNone is returned.

## ◆ GetSimpleNodeAtPath() [1/2]

XMP_PRIVATE spISimpleNode AdobeXMPCore::ICompositeNode_v1::GetSimpleNodeAtPath | ( | const spcIPath & | path | ) |
| inline

Definition at line 147 of file ICompositeNode.h.

147 {
148 auto node = GetNodeAtPath( path );
149 if ( node ) return node->ConvertToSimpleNode();
150 return spISimpleNode();
151 }

## ◆ GetSimpleNodeAtPath() [2/2]

XMP_PRIVATE spcISimpleNode AdobeXMPCore::ICompositeNode_v1::GetSimpleNodeAtPath | ( | const spcIPath & | path | ) | const
| inline

Get a simple node specified by the path relative to the node.

Parameters

  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path from the node to the node client is interested in.

Returns
  A shared pointer to const or non const #ISimpleNode object containing node.

Note
  In case no node exists at the given path an invalid shared pointer is returned.

Attention
  Error is thrown in case
  - a node exists at the given path but is not a simple node.

Definition at line 141 of file ICompositeNode.h.

141 {
142 auto node = GetNodeAtPath( path );
143 if ( node ) return node->ConvertToSimpleNode();
144 return spcISimpleNode();
145 }

## ◆ GetStructureNodeAtPath() [1/2]

XMP_PRIVATE spIStructureNode AdobeXMPCore::ICompositeNode_v1::GetStructureNodeAtPath | ( | const spcIPath & | path | ) |
| inline

Definition at line 170 of file ICompositeNode.h.

170 {
171 auto node = GetNodeAtPath( path );
172 if ( node ) return node->ConvertToStructureNode();
173 return spIStructureNode();
174 }

## ◆ GetStructureNodeAtPath() [2/2]

XMP_PRIVATE spcIStructureNode AdobeXMPCore::ICompositeNode_v1::GetStructureNodeAtPath | ( | const spcIPath & | path | ) | const
| inline

Get a structure node specified by the path relative to the node.

Parameters

  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path from the node to the node client is interested in.

Returns
  A shared pointer to const or non const #IStructureNode object containing node.

Note
  In case no node exists at the given path an invalid shared pointer is returned.

Attention
  Error is thrown in case
  - a node exists at the given path but is not a structure node.

Definition at line 164 of file ICompositeNode.h.

164 {
165 auto node = GetNodeAtPath( path );
166 if ( node ) return node->ConvertToStructureNode();
167 return spcIStructureNode();
168 }

## ◆ InsertNodeAtPath()

virtual void APICALL AdobeXMPCore::ICompositeNode_v1::InsertNodeAtPath | ( | const spINode & | node,
|  | const spcIPath & | path
| ) |  |
| pure virtual

Inserts a given node at the path relative to the composite node.

Parameters

  [in] | node | Shared pointer to an object of #AdobeXMPCore::INode containing the node to be inserted at the specified relative path.
  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path.

Note
  All the hierarchy of nodes is created if not present.
  This operation is not currently implemented for the ICompositeNode interface.

Attention
  Error is thrown in following cases:
  1. given node is invalid.
  2. type of given node is not same as other child items of the array node.
  3. given node is already a child of some other node.
  4. given path is invalid or logically incorrect.
  5. type of given node is not suitable for the destination location.
  6. a node already exists at the specified path.

## ◆ Iterator() [1/2]

XMP_PRIVATE spcINodeIterator AdobeXMPCore::ICompositeNode_v1::Iterator | ( |  | ) | const
| inline

Definition at line 118 of file ICompositeNode.h.

118 {
119 return const_cast< ICompositeNode_v1 * >( this )->Iterator();
120 }

## ◆ Iterator() [2/2]

virtual spINodeIterator APICALL AdobeXMPCore::ICompositeNode_v1::Iterator | ( |  | ) |
| pure virtual

Get an iterator object to iterate over all the child nodes of the composite node.

Returns
  a shared pointer to a const or non const #INodeIterator object.

## ◆ RemoveNodeAtPath()

virtual spINode APICALL AdobeXMPCore::ICompositeNode_v1::RemoveNodeAtPath | ( | const spcIPath & | path | ) |
| pure virtual

Removes the node specified by the path relative to the composite node.

Parameters

  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path from the node to the node client is interested in.

Returns
  A shared pointer to #AdobeXMPCore::INode object containing node which is removed from the tree.

Note
  In case no node exists at the given path an invalid shared pointer is returned.

## ◆ ReplaceNodeAtPath()

virtual spINode APICALL AdobeXMPCore::ICompositeNode_v1::ReplaceNodeAtPath | ( | const spINode & | node,
|  | const spcIPath & | path
| ) |  |
| pure virtual

Replaces an existing node with the given node at the path relative to the composite node..

Parameters

  [in] | node | Shared pointer to an object of #AdobeXMPCore::INode.
  [in] | path | Shared pointer to a const #AdobeXMPCore::IPath object containing the relative path.

Returns
  a Shared pointer to the node being replaced.

Note
  This operation is not currently implemented for the ICompositeNode interface.

Attention
  Error is thrown in following cases:
  1. given node is invalid.
  2. type of given node is not same as other child items of the array node.
  3. given node is already a child of some other node.
  4. given index is less than 1 or greater than current child count.
  5. type of given node is not suitable for the destination location.
  6. no node exists at the specified path.

The documentation for this class was generated from the following file:

- public/include/XMPCore/Interfaces/ICompositeNode.h

AdobeXMPCore::spIStructureNode
shared_ptr< IStructureNode > spIStructureNode
Definition: XMPCoreFwdDeclarations.h:103
AdobeXMPCore::spISimpleNode
shared_ptr< ISimpleNode > spISimpleNode
Definition: XMPCoreFwdDeclarations.h:79
AdobeXMPCore::ICompositeNode_v1::Iterator
virtual spINodeIterator APICALL Iterator()=0
Get an iterator object to iterate over all the child nodes of the composite node.
AdobeXMPCore::spIArrayNode
shared_ptr< IArrayNode > spIArrayNode
Definition: XMPCoreFwdDeclarations.h:115
AdobeXMPCore::spcISimpleNode
shared_ptr< const ISimpleNode > spcISimpleNode
Definition: XMPCoreFwdDeclarations.h:80
AdobeXMPCore::spcIArrayNode
shared_ptr< const IArrayNode > spcIArrayNode
Definition: XMPCoreFwdDeclarations.h:116
AdobeXMPCore::ICompositeNode_v1::GetNodeAtPath
XMP_PRIVATE spcINode GetNodeAtPath(const spcIPath &path) const
Get the node specified by the path relative to the composite node.
Definition: ICompositeNode.h:49
AdobeXMPCore::spcIStructureNode
shared_ptr< const IStructureNode > spcIStructureNode
Definition: XMPCoreFwdDeclarations.h:104