XMP Toolkit SDK  6.0.0
IPath.h
Go to the documentation of this file.
1 #ifndef __IPath_h__
2 #define __IPath_h__ 1
3 
4 // =================================================================================================
5 // Copyright 2014 Adobe
6 // All Rights Reserved.
7 //
8 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
9 // of the Adobe license agreement accompanying it. If you have received this file from a source other
10 // than Adobe, then your use, modification, or distribution of it requires the prior written permission
11 // of Adobe.
12 // =================================================================================================
13 
17 
18 namespace AdobeXMPCore {
19 
29  : public virtual ISharedObject
30  , public virtual IVersionable
31  {
32  public:
33 
40  virtual spcINameSpacePrefixMap APICALL RegisterNameSpacePrefixMap( const spcINameSpacePrefixMap & map ) = 0;
41 
53  virtual spIUTF8String APICALL Serialize( const spcINameSpacePrefixMap & map = spcINameSpacePrefixMap() ) const = 0;
54 
61  virtual void APICALL AppendPathSegment( const spcIPathSegment & segment ) = 0;
62 
70  virtual spcIPathSegment APICALL RemovePathSegment( sizet index ) = 0;
71 
79  virtual spcIPathSegment APICALL GetPathSegment( sizet index ) const = 0;
80 
85  virtual sizet APICALL Size() const __NOTHROW__ = 0;
86 
91  XMP_PRIVATE bool IsEmpty() const {
92  return Size() == 0;
93  }
94 
98  virtual void APICALL Clear() __NOTHROW__ = 0;
99 
110  virtual spIPath APICALL Clone( sizet startingIndex = 1, sizet countOfSegments = kMaxSize ) const = 0;
111 
114 
120  virtual pIPath APICALL GetActualIPath() __NOTHROW__ = 0;
121  XMP_PRIVATE pcIPath GetActualIPath() const __NOTHROW__ {
122  return const_cast< IPath_v1 * >( this )->GetActualIPath();
123  }
126 
132  virtual AdobeXMPCore_Int::pIPath_I APICALL GetIPath_I() __NOTHROW__ = 0;
133 
134  XMP_PRIVATE AdobeXMPCore_Int::pcIPath_I GetIPath_I() const __NOTHROW__ {
135  return const_cast< IPath_v1 * >( this )->GetIPath_I();
136  }
139 
146  XMP_PRIVATE static spIPath MakeShared( pIPath_base ptr );
147  XMP_PRIVATE static spcIPath MakeShared( pcIPath_base ptr ) {
148  return MakeShared( const_cast< pIPath_base >( ptr ) );
149  }
152 
157  XMP_PRIVATE static uint64 GetInterfaceID() { return kIPathID; }
158 
163  XMP_PRIVATE static uint32 GetInterfaceVersion() { return 1; }
165 
166  // static factory functions
167 
172  XMP_PRIVATE static spIPath CreatePath();
173 
187  XMP_PRIVATE static spIPath ParsePath( const char * path, sizet pathLength, const spcINameSpacePrefixMap & map );
188 
189 
190  protected:
194  virtual ~IPath_v1() __NOTHROW__ {}
195 
197  virtual pcINameSpacePrefixMap_base APICALL registerNameSpacePrefixMap( pcINameSpacePrefixMap_base map, pcIError_base & error ) __NOTHROW__ = 0;
198  virtual pIUTF8String_base APICALL serialize( pcINameSpacePrefixMap_base map, pcIError_base & error ) const __NOTHROW__ = 0;
199  virtual void APICALL appendPathSegment( pcIPathSegment_base segment, pcIError_base & error ) __NOTHROW__ = 0;
200  virtual pcIPathSegment_base APICALL removePathSegment( sizet index, pcIError_base & error ) __NOTHROW__ = 0;
201  virtual pcIPathSegment_base APICALL getPathSegment( sizet index, pcIError_base & error ) const __NOTHROW__ = 0;
202  virtual pIPath_base APICALL clone( sizet startingIndex, sizet countOfSegemetns, pcIError_base & error ) const __NOTHROW__ = 0;
203 
204 
205  #ifdef FRIEND_CLASS_DECLARATION
206  FRIEND_CLASS_DECLARATION();
207  #endif
210 
211  };
212 }
213 
214 #endif // __IPath_h__
AdobeXMPCore::IPath_v1::~IPath_v1
virtual ~IPath_v1() __NOTHROW__
Definition: IPath.h:194
AdobeXMPCore::IPath_v1
Version1 of the interface that provides an easy iterative description of a specific path into the XMP...
Definition: IPath.h:28
XMP_PRIVATE
#define XMP_PRIVATE
Definition: XMP_Environment.h:222
__NOTHROW__
#define __NOTHROW__
Definition: XMPCommonDefines.h:147
AdobeXMPCore::pcIPathSegment_base
const typedef IPathSegment_v1 * pcIPathSegment_base
Definition: XMPCoreFwdDeclarations.h:39
AdobeXMPCore::spcINameSpacePrefixMap
shared_ptr< const INameSpacePrefixMap > spcINameSpacePrefixMap
Definition: XMPCoreFwdDeclarations.h:32
AdobeXMPCore::pcIPath_base
const typedef IPath_v1 * pcIPath_base
Definition: XMPCoreFwdDeclarations.h:51
AdobeXMPCore::spcIPathSegment
shared_ptr< const IPathSegment > spcIPathSegment
Definition: XMPCoreFwdDeclarations.h:44
XMP_PUBLIC
#define XMP_PUBLIC
Definition: XMP_Environment.h:221
AdobeXMPCore::pcINameSpacePrefixMap_base
const typedef INameSpacePrefixMap_v1 * pcINameSpacePrefixMap_base
Definition: XMPCoreFwdDeclarations.h:27
AdobeXMPCore::pcIPath
const typedef IPath * pcIPath
Definition: XMPCoreFwdDeclarations.h:54
ISharedObject.h
AdobeXMPCore
Definition: IArrayNode.h:18
AdobeXMPCommon::spIUTF8String
shared_ptr< IUTF8String > spIUTF8String
Definition: XMPCommonFwdDeclarations.h:79
AdobeXMPCommon::uint32
XMP_Uns32 uint32
Definition: XMPCommonDefines.h:174
XMPCoreFwdDeclarations.h
AdobeXMPCore::spIPath
shared_ptr< IPath > spIPath
Definition: XMPCoreFwdDeclarations.h:55
AdobeXMPCommon::sizet
uint32 sizet
Definition: XMPCommonDefines.h:176
AdobeXMPCore::pIPath_base
IPath_v1 * pIPath_base
Definition: XMPCoreFwdDeclarations.h:50
AdobeXMPCommon::IVersionable
Interface that serves as the base interface for all the externally exposed interfaces which needs to ...
Definition: IVersionable.h:30
AdobeXMPCore::pIPath
IPath * pIPath
Definition: XMPCoreFwdDeclarations.h:53
AdobeXMPCore::IPath_v1::IsEmpty
XMP_PRIVATE bool IsEmpty() const
To check whether path is empty or not.
Definition: IPath.h:91
REQ_FRIEND_CLASS_DECLARATION
#define REQ_FRIEND_CLASS_DECLARATION()
Definition: XMPCommonDefines.h:137
AdobeXMPCore_Int::pcIPath_I
const typedef IPath_I * pcIPath_I
Definition: XMPCoreFwdDeclarations.h:248
IVersionable.h
AdobeXMPCommon::IUTF8String_v1
Version1 of the interface that represents an UTF8String.
Definition: IUTF8String.h:25
AdobeXMPCore_Int
Definition: XMPCoreFwdDeclarations.h:233
AdobeXMPCore::kIPathID
static const uint64 kIPathID(0x6350617468202020)
AdobeXMPCore::spcIPath
shared_ptr< const IPath > spcIPath
Definition: XMPCoreFwdDeclarations.h:56
AdobeXMPCommon::pcIError_base
const typedef IError_v1 * pcIError_base
Definition: XMPCommonFwdDeclarations.h:64
AdobeXMPCore_Int::pIPath_I
IPath_I * pIPath_I
Definition: XMPCoreFwdDeclarations.h:246
AdobeXMPCommon::uint64
XMP_Uns64 uint64
Definition: XMPCommonDefines.h:172
AdobeXMPCommon::kMaxSize
const sizet kMaxSize((sizet) -1)
AdobeXMPCommon::ISharedObject
Interface that serves as the base interface of all the externally exposed interfaces.
Definition: ISharedObject.h:29