API for access to the XMP Toolkit iteration services. More...
#include <TXMPIterator.hpp>
Public Member Functions | |
void | operator= (const TXMPIterator< tStringObj > &rhs) |
Assignment operator, assigns the internal ref and increments the ref count. More... | |
TXMPIterator (const TXMPIterator< tStringObj > &original) | |
Copy constructor, creates a client object refering to the same internal object. More... | |
TXMPIterator (const TXMPMeta< tStringObj > &xmpObj, XMP_StringPtr schemaNS, XMP_StringPtr propName, XMP_OptionBits options=0) | |
Constructs an iterator for properties within a schema in an XMP object. More... | |
TXMPIterator (const TXMPMeta< tStringObj > &xmpObj, XMP_StringPtr schemaNS, XMP_OptionBits options=0) | |
Constructs an iterator for a subtree of properties within an XMP object. More... | |
TXMPIterator (const TXMPMeta< tStringObj > &xmpObj, XMP_OptionBits options=0) | |
Constructs an iterator for the entire data tree within an XMP object. More... | |
TXMPIterator (XMP_StringPtr schemaNS, XMP_StringPtr propName, XMP_OptionBits options) | |
Constructs an iterator for the global tables of the XMP toolkit. Not implemented. More... | |
virtual | ~TXMPIterator () throw () |
Destructor, typical virtual destructor. More... | |
bool | Next (tStringObj *schemaNS=0, tStringObj *propPath=0, tStringObj *propValue=0, XMP_OptionBits *options=0) |
Next() visits the next node in the iteration. More... | |
void | Skip (XMP_OptionBits options) |
Skip() skips some portion of the remaining iterations. More... | |
Private Member Functions | |
TXMPIterator () | |
Static Private Member Functions | |
static void | SetClientString (void *clientPtr, XMP_StringPtr valuePtr, XMP_StringLen valueLen) |
Private Attributes | |
XMPIteratorRef | iterRef |
API for access to the XMP Toolkit iteration services.
TXMPIterator
provides a uniform means to iterate over the schema and properties within an XMP object. TXMPIterator
is a template class which must be instantiated with a string class such as std::string
. See the instructions in XMP.hpp, and the Overview for a discussion of the overall architecture of the XMP API. Access these functions through the concrete class, SXMPIterator
.
To understand how iteration works, you should have a thorough understanding of the XMP data tree, as described in the XMP Specification Part 1. You might also find it helpful to create some complex XMP and examine the output of TXMPMeta::DumpObject()
.
TXMPIterator::Next()
.A TXMPIterator
constructor defines a starting point for the iteration, and options that control how it proceeds. By default, iteration starts at the root and visits all nodes beneath it in a depth-first manner. The root node iteself is not visited; the first visited node is a schema node. You can provide a schema name or property path to select a different starting node. By default, this visits the named root node first then all nodes beneath it in a depth-first manner.
The function TXMPIterator::Next()
delivers the schema URI, path, and option flags for the node being visited. If the node is simple, it also delivers the value. Qualifiers for this node are visited next. The fields of a struct or items of an array are visited after the qualifiers of the parent.
You can specify options when contructing the iteration object to control how the iteration is performed.
kXMP_IterJustChildren
- Visit just the immediate children of the root. Skip the root itself and all nodes below the immediate children. This omits the qualifiers of the immediate children, the qualifier nodes being below what they qualify. kXMP_IterJustLeafNodes
- Visit just the leaf property nodes and their qualifiers. kXMP_IterJustLeafName
- Return just the leaf component of the node names. The default is to return the full path name. kXMP_IterOmitQualifiers
- Do not visit the qualifiers of a node. Definition at line 79 of file TXMPIterator.hpp.
TXMPIterator< tStringObj >::TXMPIterator | ( | const TXMPIterator< tStringObj > & | original | ) |
Copy constructor, creates a client object refering to the same internal object.
Creates a new client iterator that refers to the same underlying iterator as an existing object.
original | An existing iteration object to copy. |
TXMPIterator< tStringObj >::TXMPIterator | ( | const TXMPMeta< tStringObj > & | xmpObj, |
XMP_StringPtr | schemaNS, | ||
XMP_StringPtr | propName, | ||
XMP_OptionBits | options = 0 |
||
) |
Constructs an iterator for properties within a schema in an XMP object.
See the class description for the general operation of an XMP object iterator. Overloaded forms are provided to iterate the entire data tree, a subtree rooted at a specific node, or properties within a specific schema.
xmpObj | The XMP object over which to iterate. |
schemaNS | Optional schema namespace URI to restrict the iteration. To visit all of the schema, pass 0 or the empty string "". |
propName | Optional property name to restrict the iteration. May be an arbitrary path expression. If provided, a schema URI must also be provided. To visit all properties, pass 0 or the empty string "". |
options | Option flags to control the iteration. A logical OR of these bit flag constants:
|
TXMPIterator< tStringObj >::TXMPIterator | ( | const TXMPMeta< tStringObj > & | xmpObj, |
XMP_StringPtr | schemaNS, | ||
XMP_OptionBits | options = 0 |
||
) |
Constructs an iterator for a subtree of properties within an XMP object.
See the class description for the general operation of an XMP object iterator. Overloaded forms are provided to iterate the entire data tree, a subtree rooted at a specific node, or properties within a specific schema.
xmpObj | The XMP object over which to iterate. |
schemaNS | Optional schema namespace URI to restrict the iteration. To visit all of the schema, pass 0 or the empty string "". |
options | Option flags to control the iteration. A logical OR of these bit flag constants:
|
TXMPIterator< tStringObj >::TXMPIterator | ( | const TXMPMeta< tStringObj > & | xmpObj, |
XMP_OptionBits | options = 0 |
||
) |
Constructs an iterator for the entire data tree within an XMP object.
See the class description for the general operation of an XMP object iterator. Overloaded forms are provided to iterate the entire data tree, a subtree rooted at a specific node, or properties within a specific schema.
xmpObj | The XMP object over which to iterate. |
options | Option flags to control the iteration. A logical OR of these bit flag constants:
|
TXMPIterator
object. TXMPIterator< tStringObj >::TXMPIterator | ( | XMP_StringPtr | schemaNS, |
XMP_StringPtr | propName, | ||
XMP_OptionBits | options | ||
) |
Constructs an iterator for the global tables of the XMP toolkit. Not implemented.
|
virtual |
Destructor, typical virtual destructor.
|
private |
bool TXMPIterator< tStringObj >::Next | ( | tStringObj * | schemaNS = 0 , |
tStringObj * | propPath = 0 , |
||
tStringObj * | propValue = 0 , |
||
XMP_OptionBits * | options = 0 |
||
) |
Next()
visits the next node in the iteration.
Proceeds to the next node according to the options specified on creation of this object, and delivers the schema URI, path, and option flags for the node being visited. If the node is simple, it also delivers the value.
schemaNS | [out] A string object in which to return the assigned the schema namespace URI of the current property. Can be null if the value is not wanted. |
propPath | [out] A string object in which to return the XPath name of the current property. Can be null if the value is not wanted. |
propValue | [out] A string object in which to return the value of the current property. Can be null if the value is not wanted. |
options | [out] A buffer in which to return the flags describing the current property, which are a logical OR of XMP_OptionBits bit-flag constants. |
void TXMPIterator< tStringObj >::operator= | ( | const TXMPIterator< tStringObj > & | rhs | ) |
Assignment operator, assigns the internal ref and increments the ref count.
Assigns the internal reference from an existing object and increments the reference count on the underlying internal XMP iterator.
rhs | An existing iteration object. |
|
staticprivate |
void TXMPIterator< tStringObj >::Skip | ( | XMP_OptionBits | options | ) |
Skip()
skips some portion of the remaining iterations.
options | Option flags to control the iteration, a logical OR of these bit-flag constants:
|
|
private |
Definition at line 225 of file TXMPIterator.hpp.