XMP Toolkit SDK  6.0.0
AdobeXMPCore::IPath_v1 Class Referenceabstract

Version1 of the interface that provides an easy iterative description of a specific path into the XMP tree. More...

#include <IPath.h>

Inheritance diagram for AdobeXMPCore::IPath_v1:
AdobeXMPCommon::ISharedObject AdobeXMPCommon::IVersionable

Public Member Functions

virtual spcINameSpacePrefixMap APICALL RegisterNameSpacePrefixMap (const spcINameSpacePrefixMap &map)=0
 Registers a map of namespace and prefix with the object. This map will be used during serialization and parsing. More...
 
virtual spIUTF8String APICALL Serialize (const spcINameSpacePrefixMap &map=spcINameSpacePrefixMap()) const =0
 Serializes the IPath object to a utf8 string representation. This will produce either a long form of the path using the full namespace strings or short form of the path using the prefix for the namespace. More...
 
virtual void APICALL AppendPathSegment (const spcIPathSegment &segment)=0
 Appends a path segment to the path. More...
 
virtual spcIPathSegment APICALL RemovePathSegment (sizet index)=0
 Removes a path segment from the path. More...
 
virtual spcIPathSegment APICALL GetPathSegment (sizet index) const =0
 Gets the path segment at a particular index in the path. More...
 
virtual sizet APICALL Size () const __NOTHROW__=0
 Gets the number of the path segments in the path. More...
 
XMP_PRIVATE bool IsEmpty () const
 To check whether path is empty or not. More...
 
virtual void APICALL Clear () __NOTHROW__=0
 Clears the path by removing all the path segments from it. More...
 
virtual spIPath APICALL Clone (sizet startingIndex=1, sizet countOfSegments=kMaxSize) const =0
 Gets a new path having a selected range of path segments. More...
 
- 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...
 

Static Public Member Functions

static XMP_PRIVATE spIPath CreatePath ()
 Creates an empty IPath object. More...
 
static XMP_PRIVATE spIPath ParsePath (const char *path, sizet pathLength, const spcINameSpacePrefixMap &map)
 Creates a path from a char buffer which contains the serialized path. More...
 

Protected Member Functions

virtual ~IPath_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 ()
 

Detailed Description

Version1 of the interface that provides an easy iterative description of a specific path into the XMP tree.

Path consists of multiple path segments in an order and each #IPathSegment represents one segment of the path into the XMP tree. Provides all the functions to create path and get the various properties of a path.

Attention
Do not support multi-threading.
Note
Index in the path are 1-based.

Definition at line 28 of file IPath.h.

Constructor & Destructor Documentation

◆ ~IPath_v1()

virtual AdobeXMPCore::IPath_v1::~IPath_v1 ( )
inlineprotectedvirtual

Destructor

Definition at line 194 of file IPath.h.

194 {}

Member Function Documentation

◆ AppendPathSegment()

virtual void APICALL AdobeXMPCore::IPath_v1::AppendPathSegment ( const spcIPathSegment segment)
pure virtual

Appends a path segment to the path.

Parameters
[in]segmentA shared pointer to a const #AdobeXMPCore::IPathSegment object.
Attention
Error is thrown in case
  • segment is not a valid shared pointer.

◆ Clear()

virtual void APICALL AdobeXMPCore::IPath_v1::Clear ( )
pure virtual

Clears the path by removing all the path segments from it.

◆ Clone()

virtual spIPath APICALL AdobeXMPCore::IPath_v1::Clone ( sizet  startingIndex = 1,
sizet  countOfSegments = kMaxSize 
) const
pure virtual

Gets a new path having a selected range of path segments.

Parameters
[in]startingIndexIndicates the starting index of the path segment to be part of the returned path object. Default value is 1.
[in]countOfSegmentsIndicates the count of the path segments to be part of the returned path object starting from startingIndex. Default value is #AdobeXMPCommon::kMaxSize.
Note
In case countOfSegments is more than the number of segments available in the path object starting from the starting index then internally it is truncated to the number of path segments available.
Attention
Error is thrown in case
  • startingIndex is more than the count of segments in the object.

◆ CreatePath()

static XMP_PRIVATE spIPath AdobeXMPCore::IPath_v1::CreatePath ( )
static

Creates an empty IPath object.

Returns
a shared pointer to an empty IPath object

◆ GetPathSegment()

virtual spcIPathSegment APICALL AdobeXMPCore::IPath_v1::GetPathSegment ( sizet  index) const
pure virtual

Gets the path segment at a particular index in the path.

Parameters
[in]indexIndicates the index for the path segment in the path.
Returns
A shared pointer to a const path segment.
Attention
Error is thrown in case -index is out of bounds.

◆ IsEmpty()

XMP_PRIVATE bool AdobeXMPCore::IPath_v1::IsEmpty ( ) const
inline

To check whether path is empty or not.

Returns
A bool object indicating true in case the path is empty (no path segment)

Definition at line 91 of file IPath.h.

91  {
92  return Size() == 0;
93  }

◆ ParsePath()

static XMP_PRIVATE spIPath AdobeXMPCore::IPath_v1::ParsePath ( const char *  path,
sizet  pathLength,
const spcINameSpacePrefixMap map 
)
static

Creates a path from a char buffer which contains the serialized path.

Parameters
[in]pathPointer to a const char buffer containing serialized form of the path.
[in]pathLengthNumber of characters in the path. In case path in null terminated set it to #AdobeXMPCommon::npos.
[in]mapA shared pointer to a const #AdobeXMPCore::IXMPNameSpacePrefixMap object which will contain the mapping from nameSpaces to prefixes.
Returns
A shared pointer to a #AdobeXMPCore::IPath object.
Note
In case the serializedPath is NULL or the contents are empty then it will result in an empty path.
This operation is currently not implemented for the IPath interface.
Attention
Error is thrown in case
  • no mapping exists for a prefix to name space.
  • path contains invalid data.

◆ RegisterNameSpacePrefixMap()

virtual spcINameSpacePrefixMap APICALL AdobeXMPCore::IPath_v1::RegisterNameSpacePrefixMap ( const spcINameSpacePrefixMap map)
pure virtual

Registers a map of namespace and prefix with the object. This map will be used during serialization and parsing.

Parameters
[in]mapA shared pointer of an object #AdobeXMPCore::INameSpacePrefixMap.
Returns
A shared pointer to the const map registered previously with the object.

◆ RemovePathSegment()

virtual spcIPathSegment APICALL AdobeXMPCore::IPath_v1::RemovePathSegment ( sizet  index)
pure virtual

Removes a path segment from the path.

Parameters
[in]indexIndicates the index of the path segment to be removed.
Returns
A shared pointer to the const path segment removed.
Attention
Error is thrown in case
  • index is out of bounds.

◆ Serialize()

virtual spIUTF8String APICALL AdobeXMPCore::IPath_v1::Serialize ( const spcINameSpacePrefixMap map = spcINameSpacePrefixMap()) const
pure virtual

Serializes the IPath object to a utf8 string representation. This will produce either a long form of the path using the full namespace strings or short form of the path using the prefix for the namespace.

Parameters
[in]mapA shared pointer to a const #AdobeXMPCore::INameSpacePrefixMap object which can contain the mapping for nameSpaces to prefixes. They will take precedence over the map registered with the object.
Returns
A shard pointer to #AdobeXMPCommon::IUTF8String object containing serialized form of path.
Note
In case map is not a valid shared pointer all the mappings will be picked from the map registered with the object. If neither a map is registered nor it is provided in the arguments then it will serialize to long form of the path.
Attention
Error will be thrown in case
  • no prefix exists for a namespace used in the path.

◆ Size()

virtual sizet APICALL AdobeXMPCore::IPath_v1::Size ( ) const
pure virtual

Gets the number of the path segments in the path.

Returns
The count of the path segments in the path.

The documentation for this class was generated from the following file:
AdobeXMPCore::IPath_v1::Size
virtual sizet APICALL Size() const __NOTHROW__=0
Gets the number of the path segments in the path.