| XMP Toolkit SDK 6.0.0

INameSpacePrefixMap.h
Go to the documentation of this file.
1 #ifndef INameSpacePrefixMap_h__
2 #define INameSpacePrefixMap_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 #include "XMPCore/XMPCoreFwdDeclarations.h"
16 #include "XMPCommon/Interfaces/BaseInterfaces/ISharedObject.h"
17 #include "XMPCommon/Interfaces/BaseInterfaces/IVersionable.h"
18 #include "XMPCommon/Interfaces/BaseInterfaces/IThreadSafe.h"
19
20 namespace AdobeXMPCore {
21
28 class XMP_PUBLIC INameSpacePrefixMap_v1
29 : public virtual ISharedObject
30 , public virtual IVersionable
31 , public virtual IThreadSafe
32 {
33 public:
34
46 virtual bool APICALL Insert( const char * prefix, sizet prefixLength, const char * nameSpace, sizet nameSpaceLength ) = 0;
47
58 virtual bool APICALL RemovePrefix( const char * prefix, sizet prefixLength ) = 0;
59
70 virtual bool APICALL RemoveNameSpace( const char * nameSpace, sizet nameSpaceLength ) = 0;
71
81 virtual bool APICALL IsPrefixPresent( const char * prefix, sizet prefixLength ) const = 0;
82
92 virtual bool APICALL IsNameSpacePresent( const char * nameSpace, sizet nameSpaceLength ) const = 0;
93
104 virtual spcIUTF8String APICALL GetNameSpace( const char * prefix, sizet prefixLength ) const = 0;
105
116 virtual spcIUTF8String APICALL GetPrefix( const char * nameSpace, sizet nameSpaceLength ) const = 0;
117
122 virtual sizet APICALL Size() const __NOTHROW__ = 0;
123
128 bool IsEmpty() const __NOTHROW__;
129
133 virtual void APICALL Clear() __NOTHROW__ = 0;
134
138 // \return A shared pointer to INameSpacePrefixMap which is exact replica of the current object.
140 virtual spINameSpacePrefixMap APICALL Clone() const = 0;
141
144
150 virtual pINameSpacePrefixMap APICALL GetActualINameSpacePrefixMap() __NOTHROW__ = 0;
151 XMP_PRIVATE pcINameSpacePrefixMap GetActualINameSpacePrefixMap() const __NOTHROW__ {
152 return const_cast< INameSpacePrefixMap_v1 * >( this )->GetActualINameSpacePrefixMap();
153 }
156
162 virtual AdobeXMPCore_Int::pINameSpacePrefixMap_I APICALL GetINameSpacePrefixMap_I() __NOTHROW__ = 0;
163
164 XMP_PRIVATE AdobeXMPCore_Int::pcINameSpacePrefixMap_I GetINameSpacePrefixMap_I() const __NOTHROW__ {
165 return const_cast< INameSpacePrefixMap_v1 * >( this )->GetINameSpacePrefixMap_I();
166 }
169
176 XMP_PRIVATE static spINameSpacePrefixMap MakeShared( pINameSpacePrefixMap_base ptr );
177 XMP_PRIVATE static spcINameSpacePrefixMap MakeShared( pcINameSpacePrefixMap_base ptr ) {
178 return MakeShared( const_cast< pINameSpacePrefixMap_base >( ptr ) );
179 }
182
187 XMP_PRIVATE static uint64 GetInterfaceID() { return kINameSpacePrefixMapID; }
188
193 XMP_PRIVATE static uint32 GetInterfaceVersion() { return 1; }
194
196
197
198 // static factory functions
199
205 XMP_PRIVATE static spcINameSpacePrefixMap GetDefaultNameSpacePrefixMap();
206
211 XMP_PRIVATE static spINameSpacePrefixMap CreateNameSpacePrefixMap();
212
213 protected:
217 virtual ~INameSpacePrefixMap_v1() __NOTHROW__ {}
218
220 const uint32 kPrefixIsParameter = 0;
221 const uint32 kNameSpaceIsParameter = 1;
222
223 virtual uint32 APICALL insert( const char * prefix, sizet prefixLength, const char * nameSpace, sizet nameSpaceLength, pcIError_base & error ) __NOTHROW__ = 0;
224 virtual uint32 APICALL remove( uint32 keyType, const char * key, sizet keyLength, pcIError_base & error ) __NOTHROW__ = 0;
225 virtual uint32 APICALL isPresent( uint32 keyType, const char * key, sizet keyLength, pcIError_base & error ) const __NOTHROW__ = 0;
226 virtual pcIUTF8String_base APICALL get( uint32 keyType, const char * key, sizet keyLength, pcIError_base & error ) const __NOTHROW__ = 0;
227 virtual pINameSpacePrefixMap_base APICALL clone( pcIError_base & error ) const __NOTHROW__ = 0;
228
229 #ifdef FRIEND_CLASS_DECLARATION
230 FRIEND_CLASS_DECLARATION();
231 #endif
232 REQ_FRIEND_CLASS_DECLARATION();
234
235 };
236 }
237
238 #endif // INameSpacePrefixMap_h__
XMP_PRIVATE
#define XMP_PRIVATE
Definition: XMP_Environment.h:222
__NOTHROW__
#define __NOTHROW__
Definition: XMPCommonDefines.h:147
AdobeXMPCore::spcINameSpacePrefixMap
shared_ptr< const INameSpacePrefixMap > spcINameSpacePrefixMap
Definition: XMPCoreFwdDeclarations.h:32
XMP_PUBLIC
#define XMP_PUBLIC
Definition: XMP_Environment.h:221
AdobeXMPCommon::pcIUTF8String_base
const typedef IUTF8String_v1 * pcIUTF8String_base
Definition: XMPCommonFwdDeclarations.h:75
AdobeXMPCore::pcINameSpacePrefixMap_base
const typedef INameSpacePrefixMap_v1 * pcINameSpacePrefixMap_base
Definition: XMPCoreFwdDeclarations.h:27
AdobeXMPCore::pINameSpacePrefixMap
INameSpacePrefixMap * pINameSpacePrefixMap
Definition: XMPCoreFwdDeclarations.h:29
ISharedObject.h
AdobeXMPCommon::spcIUTF8String
shared_ptr< const IUTF8String > spcIUTF8String
Definition: XMPCommonFwdDeclarations.h:80
AdobeXMPCommon::IThreadSafe
Interface that serves as the base interface for all the externally exposed interfaces which needs to ...
Definition: IThreadSafe.h:29
AdobeXMPCore::INameSpacePrefixMap_v1
Version1 of the interface that represents map where each entry consists of prefix string as the key a...
Definition: INameSpacePrefixMap.h:28
AdobeXMPCore
Definition: IArrayNode.h:18
IThreadSafe.h
AdobeXMPCommon::uint32
XMP_Uns32 uint32
Definition: XMPCommonDefines.h:174
XMPCoreFwdDeclarations.h
AdobeXMPCore_Int::pINameSpacePrefixMap_I
INameSpacePrefixMap_I * pINameSpacePrefixMap_I
Definition: XMPCoreFwdDeclarations.h:236
AdobeXMPCommon::sizet
uint32 sizet
Definition: XMPCommonDefines.h:176
AdobeXMPCore::kINameSpacePrefixMapID
static const uint64 kINameSpacePrefixMapID(0x634e5350724d6170)
AdobeXMPCommon::IVersionable
Interface that serves as the base interface for all the externally exposed interfaces which needs to ...
Definition: IVersionable.h:30
AdobeXMPCore_Int::pcINameSpacePrefixMap_I
const typedef INameSpacePrefixMap_I * pcINameSpacePrefixMap_I
Definition: XMPCoreFwdDeclarations.h:238
AdobeXMPCore::pcINameSpacePrefixMap
const typedef INameSpacePrefixMap * pcINameSpacePrefixMap
Definition: XMPCoreFwdDeclarations.h:30
REQ_FRIEND_CLASS_DECLARATION
#define REQ_FRIEND_CLASS_DECLARATION()
Definition: XMPCommonDefines.h:137
IVersionable.h
AdobeXMPCore::INameSpacePrefixMap_v1::~INameSpacePrefixMap_v1
virtual ~INameSpacePrefixMap_v1() __NOTHROW__
Definition: INameSpacePrefixMap.h:217
AdobeXMPCore::spINameSpacePrefixMap
shared_ptr< INameSpacePrefixMap > spINameSpacePrefixMap
Definition: XMPCoreFwdDeclarations.h:31
AdobeXMPCommon::pcIError_base
const typedef IError_v1 * pcIError_base
Definition: XMPCommonFwdDeclarations.h:64
AdobeXMPCommon::uint64
XMP_Uns64 uint64
Definition: XMPCommonDefines.h:172
AdobeXMPCommon::ISharedObject
Interface that serves as the base interface of all the externally exposed interfaces.
Definition: ISharedObject.h:29