XMP Toolkit SDK  6.0.0
IPathSegment.h
Go to the documentation of this file.
1 #ifndef __IPathSegment_h__
2 #define __IPathSegment_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 
27  : public virtual ISharedObject
28  , public virtual IVersionable
29  {
30  public:
31 
35  typedef enum {
37  kPSTNone = 0,
38 
40  kPSTProperty = 1,
41 
43  kPSTArrayIndex = 1 << 1,
44 
46  kPSTQualifier = 1 << 2,
47 
49  kPSTQualifierSelector = 1 << 3,
50 
52  kPSTAll = kAllBits
53  } ePathSegmentType;
54 
59  virtual spcIUTF8String APICALL GetNameSpace() const = 0;
60 
66  virtual spcIUTF8String APICALL GetName() const = 0;
67 
72  virtual ePathSegmentType APICALL GetType() const = 0;
73 
79  virtual sizet APICALL GetIndex() const __NOTHROW__ = 0;
80 
86  virtual spcIUTF8String APICALL GetValue() const = 0;
87 
90 
96  virtual pIPathSegment APICALL GetActualIPathSegment() __NOTHROW__ = 0;
97  XMP_PRIVATE pcIPathSegment GetActualIPathSegment() const __NOTHROW__ {
98  return const_cast< IPathSegment_v1 * >( this )->GetActualIPathSegment();
99  }
102 
108  virtual AdobeXMPCore_Int::pIPathSegment_I APICALL GetIPathSegment_I() __NOTHROW__ = 0;
109 
110  XMP_PRIVATE AdobeXMPCore_Int::pcIPathSegment_I GetIPathSegment_I() const __NOTHROW__ {
111  return const_cast< IPathSegment_v1 * >( this )->GetIPathSegment_I();
112  }
115 
123  XMP_PRIVATE static spIPathSegment MakeShared( pIPathSegment_base ptr );
124  XMP_PRIVATE static spcIPathSegment MakeShared( pcIPathSegment_base ptr ) {
125  return MakeShared( const_cast< pIPathSegment_base >( ptr ) );
126  }
129 
134  XMP_PRIVATE static uint64 GetInterfaceID() { return kIPathSegmentID; }
135 
140  XMP_PRIVATE static uint32 GetInterfaceVersion() { return 1; }
142 
143  // static factory functions
144 
145  // Factories to create the specific segments
146 
158  XMP_PRIVATE static spcIPathSegment CreatePropertyPathSegment( const char * nameSpace, sizet nameSpaceLength, const char * name, sizet nameLength );
159 
172  XMP_PRIVATE static spcIPathSegment CreateArrayIndexPathSegment( const char * nameSpace, sizet nameSpaceLength, sizet index );
173 
185  XMP_PRIVATE static spcIPathSegment CreateQualifierPathSegment( const char * nameSpace, sizet nameSpaceLength, const char * name, sizet nameLength );
186 
201  XMP_PRIVATE static spcIPathSegment CreateQualifierSelectorPathSegment( const char * nameSpace, sizet nameSpaceLength, const char * name,
202  sizet nameLength, const char * value, sizet valueLength );
203 
204 
205 
206  protected:
211 
213  virtual pcIUTF8String_base APICALL getNameSpace( pcIError_base & error ) const __NOTHROW__ = 0;
214  virtual pcIUTF8String_base APICALL getName( pcIError_base & error ) const __NOTHROW__ = 0;
215  virtual uint32 APICALL getType( pcIError_base & error ) const __NOTHROW__ = 0;
216  virtual pcIUTF8String_base APICALL getValue( pcIError_base & error ) const __NOTHROW__ = 0;
217 
218  #ifdef FRIEND_CLASS_DECLARATION
219  FRIEND_CLASS_DECLARATION();
220  #endif
223 
224  };
225 }
226 
227 #endif // __IPathSegment_h__
AdobeXMPCore::pIPathSegment_base
IPathSegment_v1 * pIPathSegment_base
Definition: XMPCoreFwdDeclarations.h:38
AdobeXMPCore::IPathSegment_v1::~IPathSegment_v1
virtual ~IPathSegment_v1() __NOTHROW__
Definition: IPathSegment.h:210
AdobeXMPCore_Int::pcIPathSegment_I
const typedef IPathSegment_I * pcIPathSegment_I
Definition: XMPCoreFwdDeclarations.h:243
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::spcIPathSegment
shared_ptr< const IPathSegment > spcIPathSegment
Definition: XMPCoreFwdDeclarations.h:44
XMP_PUBLIC
#define XMP_PUBLIC
Definition: XMP_Environment.h:221
AdobeXMPCommon::pcIUTF8String_base
const typedef IUTF8String_v1 * pcIUTF8String_base
Definition: XMPCommonFwdDeclarations.h:75
ISharedObject.h
AdobeXMPCommon::spcIUTF8String
shared_ptr< const IUTF8String > spcIUTF8String
Definition: XMPCommonFwdDeclarations.h:80
AdobeXMPCore::spIPathSegment
shared_ptr< IPathSegment > spIPathSegment
Definition: XMPCoreFwdDeclarations.h:43
AdobeXMPCore::pcIPathSegment
const typedef IPathSegment * pcIPathSegment
Definition: XMPCoreFwdDeclarations.h:42
AdobeXMPCore
Definition: IArrayNode.h:18
AdobeXMPCore::IPathSegment_v1
Version1 of the interface that represents one segment in a path to a node into the XMP tree.
Definition: IPathSegment.h:26
AdobeXMPCommon::uint32
XMP_Uns32 uint32
Definition: XMPCommonDefines.h:174
XMPCoreFwdDeclarations.h
AdobeXMPCommon::sizet
uint32 sizet
Definition: XMPCommonDefines.h:176
AdobeXMPCommon::IVersionable
Interface that serves as the base interface for all the externally exposed interfaces which needs to ...
Definition: IVersionable.h:30
AdobeXMPCore::pIPathSegment
IPathSegment * pIPathSegment
Definition: XMPCoreFwdDeclarations.h:41
AdobeXMPCore::kIPathSegmentID
static const uint64 kIPathSegmentID(0x6350617468536567)
REQ_FRIEND_CLASS_DECLARATION
#define REQ_FRIEND_CLASS_DECLARATION()
Definition: XMPCommonDefines.h:137
IVersionable.h
AdobeXMPCore_Int
Definition: XMPCoreFwdDeclarations.h:233
AdobeXMPCore_Int::pIPathSegment_I
IPathSegment_I * pIPathSegment_I
Definition: XMPCoreFwdDeclarations.h:241
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)
AdobeXMPCommon::ISharedObject
Interface that serves as the base interface of all the externally exposed interfaces.
Definition: ISharedObject.h:29