| XMP Toolkit SDK 6.0.0

IArrayNode.h
Go to the documentation of this file.
1 #ifndef __IArrayNode_h__
2 #define __IArrayNode_h__ 1
3
4 // =================================================================================================
5 // Copyright Adobe
6 // Copyright 2014 Adobe
7 // All Rights Reserved
8 //
9 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
10 // of the Adobe license agreement accompanying it. If you have received this file from a source other
11 // than Adobe, then your use, modification, or distribution of it requires the prior written permission
12 // of Adobe.
13 // =================================================================================================
14
15
16 #include "XMPCore/Interfaces/ICompositeNode.h"
17
18 namespace AdobeXMPCore {
19
27 class XMP_PUBLIC IArrayNode_v1
28 : public virtual ICompositeNode_v1
29 {
30 public:
31
35 typedef enum {
37 kAFNone = 0,
38
40 kAFUnordered = 1 << 0,
41
43 kAFOrdered = 1 << 1,
44
46 kAFAlternative = 1 << 2,
47
49 kAFAll = kAllBits
50 } eArrayForm;
51
56 virtual eArrayForm APICALL GetArrayForm() const = 0;
57
63 virtual eNodeType APICALL GetChildNodeType() const = 0;
64
73 virtual spINode APICALL GetNodeAtIndex( sizet index ) = 0;
74 XMP_PRIVATE spcINode GetNodeAtIndex( sizet index ) const {
75 return const_cast< IArrayNode_v1 * >( this )->GetNodeAtIndex( index );
76 }
78
89 XMP_PRIVATE spcISimpleNode GetSimpleNodeAtIndex( sizet index ) const {
90 auto node = GetNodeAtIndex( index );
91 if ( node ) return node->ConvertToSimpleNode();
92 return spcISimpleNode();
93 }
94
95 XMP_PRIVATE spISimpleNode GetSimpleNodeAtIndex( sizet index ) {
96 auto node = GetNodeAtIndex( index );
97 if ( node ) return node->ConvertToSimpleNode();
98 return spISimpleNode();
99 }
101
112 XMP_PRIVATE spcIStructureNode GetStructureNodeAtIndex( sizet index ) const {
113 auto node = GetNodeAtIndex( index );
114 if ( node ) return node->ConvertToStructureNode();
115 return spcIStructureNode();
116 }
117
118 XMP_PRIVATE spIStructureNode GetStructureNodeAtIndex( sizet index ) {
119 auto node = GetNodeAtIndex( index );
120 if ( node ) return node->ConvertToStructureNode();
121 return spIStructureNode();
122 }
124
135 XMP_PRIVATE spcIArrayNode GetArrayNodeAtIndex( sizet index ) const {
136 auto node = GetNodeAtIndex( index );
137 if ( node ) return node->ConvertToArrayNode();
138 return spcIArrayNode();
139 }
140
141 XMP_PRIVATE spIArrayNode GetArrayNodeAtIndex( sizet index ) {
142 auto node = GetNodeAtIndex( index );
143 if ( node ) return node->ConvertToArrayNode();
144 return spIArrayNode();
145 }
147
160 virtual void APICALL InsertNodeAtIndex( const spINode & node, sizet index ) = 0;
161
175 virtual spINode APICALL ReplaceNodeAtIndex( const spINode & node, sizet index ) = 0;
176
184 virtual spINode APICALL RemoveNodeAtIndex( sizet index ) = 0;
185
188
194 virtual pIArrayNode APICALL GetActualIArrayNode() __NOTHROW__ = 0;
195 XMP_PRIVATE pcIArrayNode GetActualIArrayNode() const __NOTHROW__ {
196 return const_cast< IArrayNode_v1 * >( this )->GetActualIArrayNode();
197 }
200
206 virtual AdobeXMPCore_Int::pIArrayNode_I APICALL GetIArrayNode_I() __NOTHROW__ = 0;
207
208 XMP_PRIVATE AdobeXMPCore_Int::pcIArrayNode_I GetIArrayNode_I() const __NOTHROW__ {
209 return const_cast< IArrayNode_v1 * >( this )->GetIArrayNode_I();
210 }
213
221 XMP_PRIVATE static spIArrayNode MakeShared( pIArrayNode_base ptr );
222 XMP_PRIVATE static spcIArrayNode MakeShared( pcIArrayNode_base ptr ) {
223 return MakeShared( const_cast< pIArrayNode_base >( ptr ) );
224 }
227
232 XMP_PRIVATE static uint64 GetInterfaceID() { return kIArrayNodeID; }
233
238 XMP_PRIVATE static uint32 GetInterfaceVersion() { return 1; }
240
241 // Factories to create the array node
242
254 XMP_PRIVATE static spIArrayNode CreateUnorderedArrayNode( const char * nameSpace, sizet nameSpaceLength, const char * name, sizet nameLength );
255
267 XMP_PRIVATE static spIArrayNode CreateOrderedArrayNode( const char * nameSpace, sizet nameSpaceLength, const char * name, sizet nameLength );
268
280 XMP_PRIVATE static spIArrayNode CreateAlternativeArrayNode( const char * nameSpace, sizet nameSpaceLength, const char * name, sizet nameLength );
281
282 protected:
286 virtual ~IArrayNode_v1() __NOTHROW__ {}
287
289 virtual uint32 APICALL getArrayForm( pcIError_base & error ) const __NOTHROW__ = 0;
290 virtual uint32 APICALL getChildNodeType( pcIError_base & error ) const __NOTHROW__ = 0;
291 virtual pINode_base APICALL getNodeAtIndex( sizet index, pcIError_base & error ) __NOTHROW__ = 0;
292 virtual void APICALL insertNodeAtIndex( pINode_base node, sizet index, pcIError_base & error ) __NOTHROW__ = 0;
293 virtual pINode_base APICALL replaceNodeAtIndex( pINode_base node, sizet index, pcIError_base & error ) __NOTHROW__ = 0;
294 virtual pINode_base APICALL removeNodeAtIndex( sizet index, pcIError_base & error ) __NOTHROW__ = 0;
295
296 #ifdef FRIEND_CLASS_DECLARATION
297 FRIEND_CLASS_DECLARATION();
298 #endif
299 REQ_FRIEND_CLASS_DECLARATION();
301
302 };
303 }
304
305 #endif // __IArrayNode_h__
AdobeXMPCore_Int::pcIArrayNode_I
const typedef IArrayNode_I * pcIArrayNode_I
Definition: XMPCoreFwdDeclarations.h:273
XMP_PRIVATE
#define XMP_PRIVATE
Definition: XMP_Environment.h:222
__NOTHROW__
#define __NOTHROW__
Definition: XMPCommonDefines.h:147
AdobeXMPCore::INode_v1
Version1 of the interface that serves as a base interface to all types of nodes in the XMP DOM.
Definition: INode.h:28
AdobeXMPCore::IArrayNode_v1::GetSimpleNodeAtIndex
XMP_PRIVATE spcISimpleNode GetSimpleNodeAtIndex(sizet index) const
Get the node at the specified index as simple node, if possible.
Definition: IArrayNode.h:89
AdobeXMPCore::IArrayNode_v1::GetArrayNodeAtIndex
XMP_PRIVATE spIArrayNode GetArrayNodeAtIndex(sizet index)
Definition: IArrayNode.h:141
AdobeXMPCore::spIStructureNode
shared_ptr< IStructureNode > spIStructureNode
Definition: XMPCoreFwdDeclarations.h:103
XMP_PUBLIC
#define XMP_PUBLIC
Definition: XMP_Environment.h:221
AdobeXMPCore::spISimpleNode
shared_ptr< ISimpleNode > spISimpleNode
Definition: XMPCoreFwdDeclarations.h:79
AdobeXMPCore::IArrayNode_v1::GetArrayNodeAtIndex
XMP_PRIVATE spcIArrayNode GetArrayNodeAtIndex(sizet index) const
Get the node at the specified index as an array node, if possible.
Definition: IArrayNode.h:135
ICompositeNode.h
AdobeXMPCore::pcIArrayNode
const typedef IArrayNode * pcIArrayNode
Definition: XMPCoreFwdDeclarations.h:114
AdobeXMPCore::pIArrayNode
IArrayNode * pIArrayNode
Definition: XMPCoreFwdDeclarations.h:113
AdobeXMPCore
Definition: IArrayNode.h:18
AdobeXMPCore_Int::pIArrayNode_I
IArrayNode_I * pIArrayNode_I
Definition: XMPCoreFwdDeclarations.h:271
AdobeXMPCommon::uint32
XMP_Uns32 uint32
Definition: XMPCommonDefines.h:174
AdobeXMPCore::IArrayNode_v1::GetSimpleNodeAtIndex
XMP_PRIVATE spISimpleNode GetSimpleNodeAtIndex(sizet index)
Definition: IArrayNode.h:95
AdobeXMPCommon::sizet
uint32 sizet
Definition: XMPCommonDefines.h:176
AdobeXMPCore::IArrayNode_v1::GetStructureNodeAtIndex
XMP_PRIVATE spIStructureNode GetStructureNodeAtIndex(sizet index)
Definition: IArrayNode.h:118
AdobeXMPCore::ICompositeNode_v1
Version1 of the interface that serves as a base interface to all composite types of nodes in the XMP ...
Definition: ICompositeNode.h:27
AdobeXMPCore::IArrayNode_v1
Version1 of the interface that represents an Array Node of XMP DOM.
Definition: IArrayNode.h:27
AdobeXMPCore::spIArrayNode
shared_ptr< IArrayNode > spIArrayNode
Definition: XMPCoreFwdDeclarations.h:115
AdobeXMPCore::spcISimpleNode
shared_ptr< const ISimpleNode > spcISimpleNode
Definition: XMPCoreFwdDeclarations.h:80
REQ_FRIEND_CLASS_DECLARATION
#define REQ_FRIEND_CLASS_DECLARATION()
Definition: XMPCommonDefines.h:137
AdobeXMPCore::spINode
shared_ptr< INode > spINode
Definition: XMPCoreFwdDeclarations.h:67
AdobeXMPCore::IArrayNode_v1::~IArrayNode_v1
virtual ~IArrayNode_v1() __NOTHROW__
Definition: IArrayNode.h:286
AdobeXMPCore::pIArrayNode_base
IArrayNode_v1 * pIArrayNode_base
Definition: XMPCoreFwdDeclarations.h:110
AdobeXMPCore::spcIArrayNode
shared_ptr< const IArrayNode > spcIArrayNode
Definition: XMPCoreFwdDeclarations.h:116
AdobeXMPCore::IArrayNode_v1::GetNodeAtIndex
XMP_PRIVATE spcINode GetNodeAtIndex(sizet index) const
Definition: IArrayNode.h:74
AdobeXMPCore::spcIStructureNode
shared_ptr< const IStructureNode > spcIStructureNode
Definition: XMPCoreFwdDeclarations.h:104
AdobeXMPCore_Int
Definition: XMPCoreFwdDeclarations.h:233
AdobeXMPCore::IArrayNode_v1::GetStructureNodeAtIndex
XMP_PRIVATE spcIStructureNode GetStructureNodeAtIndex(sizet index) const
Get the node at the specified index as structure node, if possible.
Definition: IArrayNode.h:112
AdobeXMPCore::pcIArrayNode_base
const typedef IArrayNode_v1 * pcIArrayNode_base
Definition: XMPCoreFwdDeclarations.h:111
AdobeXMPCore::kIArrayNodeID
static const uint64 kIArrayNodeID(0x634172724e6f6465)
AdobeXMPCommon::pcIError_base
const typedef IError_v1 * pcIError_base
Definition: XMPCommonFwdDeclarations.h:64
AdobeXMPCommon::uint64
XMP_Uns64 uint64
Definition: XMPCommonDefines.h:172
AdobeXMPCommon::kAllBits
static const uint32 kAllBits(0xFFFFFFFF)
AdobeXMPCore::spcINode
shared_ptr< const INode > spcINode
Definition: XMPCoreFwdDeclarations.h:68