Skip to content

Commit

Permalink
Update to XMP SDK CS6
Browse files Browse the repository at this point in the history
  • Loading branch information
hfiguiere committed May 14, 2013
1 parent 42dbac6 commit 81a4c6b
Show file tree
Hide file tree
Showing 590 changed files with 44,876 additions and 64,928 deletions.
Binary file modified XMP-Toolkit-SDK-Overview.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h" // ! Must be the first #include!
#include "XMPCore_Impl.hpp"
#include "public/include/XMP_Environment.h" // ! Must be the first #include!
#include "XMPCore/source/XMPCore_Impl.hpp"

#include "ExpatAdapter.hpp"
#include "XMPMeta.hpp"

#include "expat.h"
#include "source/ExpatAdapter.hpp"
#include "XMPCore/source/XMPMeta.hpp"

#include "third-party/expat/lib/expat.h"
#include <string.h>

using namespace std;
Expand Down
16 changes: 9 additions & 7 deletions source/XMPCore/ParseRDF.cpp → XMPCore/source/ParseRDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMPCore_Impl.hpp"
#include "ExpatAdapter.hpp"
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "XMPCore/source/XMPCore_Impl.hpp"
#include "source/ExpatAdapter.hpp"

#include <cstring>

Expand Down Expand Up @@ -646,7 +646,7 @@ FixupQualifiedNode ( XMP_Node * xmpParent )
xmpParent->children[0] = 0; // ! Remove the value node itself before the swap.
xmpParent->children.swap ( valueNode->children );

for ( size_t childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
for ( childNum = 0, childLim = xmpParent->children.size(); childNum != childLim; ++childNum ) {
XMP_Node * currChild = xmpParent->children[childNum];
currChild->parent = xmpParent;
}
Expand Down Expand Up @@ -979,7 +979,7 @@ RDF_PropertyElement ( XMP_Node * xmpParent, const XML_Node & xmlNode, bool isTop
// ws* nodeElement ws*
// end-element()
//
// This handles structs using an rdf:Description node, arrays using rdf:Bag/Seq/Alt, and typedNodes.
// This handles structs using an rdf:Description node, arrays using rdf:Bag/Seq/Alt, and Typed Nodes.
// It also catches and cleans up qualified properties written with rdf:Description and rdf:value.

static void
Expand Down Expand Up @@ -1019,13 +1019,15 @@ RDF_ResourcePropertyElement ( XMP_Node * xmpParent, const XML_Node & xmlNode, bo
} else if ( (*currChild)->name == "rdf:Alt" ) {
newCompound->options |= kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate;
} else {
// This is the Typed Node case. Add an rdf:type qualifier with a URI value.
newCompound->options |= kXMP_PropValueIsStruct;
if ( (*currChild)->name != "rdf:Description" ) {
XMP_VarString typeName ( (*currChild)->ns );
size_t colonPos = (*currChild)->name.find_first_of(':');
if ( colonPos == XMP_VarString::npos ) XMP_Throw ( "All XML elements must be in a namespace", kXMPErr_BadXMP );
typeName.append ( (*currChild)->name, colonPos, XMP_VarString::npos );
AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
typeName.append ( (*currChild)->name, colonPos+1, XMP_VarString::npos ); // Append just the local name.
XMP_Node * typeQual = AddQualifierNode ( newCompound, XMP_VarString("rdf:type"), typeName );
typeQual->options |= kXMP_PropValueIsURI;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMP_Const.h"
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "public/include/XMP_Const.h"

#include "client-glue/WXMPIterator.hpp"
#include "public/include/client-glue/WXMPIterator.hpp"

#include "XMPCore_Impl.hpp"
#include "XMPIterator.hpp"
#include "XMPCore/source/XMPCore_Impl.hpp"
#include "XMPCore/source/XMPIterator.hpp"

#if XMP_WinBuild
#pragma warning ( disable : 4101 ) // unreferenced local variable
Expand Down Expand Up @@ -131,6 +131,7 @@ WXMPIterator_Next_1 ( XMPIteratorRef xmpObjRef,

if ( propOptions == 0 ) propOptions = &voidOptionBits;

XMP_Assert( thiz->info.xmpObj != NULL );
XMP_AutoLock metaLock ( &thiz->info.xmpObj->lock, kXMP_ReadLock, (thiz->info.xmpObj != 0) );

XMP_Bool found = thiz->Next ( &schemaPtr, &schemaLen, &pathPtr, &pathLen, &valuePtr, &valueLen, propOptions );
Expand All @@ -154,6 +155,7 @@ WXMPIterator_Skip_1 ( XMPIteratorRef xmpObjRef,
{
XMP_ENTER_ObjWrite ( XMPIterator, "WXMPIterator_Skip_1" )

XMP_Assert( thiz->info.xmpObj != NULL );
XMP_AutoLock metaLock ( &thiz->info.xmpObj->lock, kXMP_ReadLock, (thiz->info.xmpObj != 0) );

thiz->Skip ( options );
Expand Down
10 changes: 5 additions & 5 deletions source/XMPCore/WXMPMeta.cpp → XMPCore/source/WXMPMeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMP_Const.h"
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "public/include/XMP_Const.h"

#include "client-glue/WXMPMeta.hpp"
#include "public/include/client-glue/WXMPMeta.hpp"

#include "XMPCore_Impl.hpp"
#include "XMPMeta.hpp"
#include "XMPCore/source/XMPCore_Impl.hpp"
#include "XMPCore/source/XMPMeta.hpp"

#if XMP_WinBuild
#pragma warning ( disable : 4101 ) // unreferenced local variable
Expand Down
10 changes: 5 additions & 5 deletions source/XMPCore/WXMPUtils.cpp → XMPCore/source/WXMPUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

// *** Should change "type * inParam" to "type & inParam"

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMP_Const.h"
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "public/include/XMP_Const.h"

#include "client-glue/WXMPUtils.hpp"
#include "public/include/client-glue/WXMPUtils.hpp"

#include "XMPCore_Impl.hpp"
#include "XMPUtils.hpp"
#include "XMPCore/source/XMPCore_Impl.hpp"
#include "XMPCore/source/XMPUtils.hpp"

#if XMP_WinBuild
#pragma warning ( disable : 4101 ) // unreferenced local variable
Expand Down
26 changes: 16 additions & 10 deletions source/XMPCore/XMPCore_Impl.cpp → XMPCore/source/XMPCore_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMP_Version.h"
#include "XMPCore_Impl.hpp"
#include "XMPMeta.hpp" // *** For use of GetNamespacePrefix in FindSchemaNode.
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "public/include/XMP_Version.h"
#include "XMPCore/source/XMPCore_Impl.hpp"
#include "XMPCore/source/XMPMeta.hpp" // *** For use of GetNamespacePrefix in FindSchemaNode.

#include "UnicodeInlines.incl_cpp"
#include "source/UnicodeInlines.incl_cpp"

#include <algorithm>

Expand Down Expand Up @@ -763,12 +763,18 @@ FindSchemaNode ( XMP_Node * xmpTree,
if ( (schemaNode == 0) && createNodes ) {

schemaNode = new XMP_Node ( xmpTree, nsURI, (kXMP_SchemaNode | kXMP_NewImplicitNode) );
XMP_StringPtr prefixPtr;
XMP_StringLen prefixLen;
bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen ); // *** Use map directly?
XMP_Assert ( found );

schemaNode->value.assign ( prefixPtr, prefixLen );
try {
XMP_StringPtr prefixPtr;
XMP_StringLen prefixLen;
bool found = XMPMeta::GetNamespacePrefix ( nsURI, &prefixPtr, &prefixLen ); // *** Use map directly?
XMP_Assert ( found );
schemaNode->value.assign ( prefixPtr, prefixLen );
} catch (...) { // Don't leak schemaNode in case of an exception before adding it to the children vector.
delete schemaNode;
throw;
}

xmpTree->children.push_back ( schemaNode );
if ( ptrPos != 0 ) *ptrPos = xmpTree->children.end() - 1;

Expand Down
31 changes: 17 additions & 14 deletions source/XMPCore/XMPCore_Impl.hpp → XMPCore/source/XMPCore_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h" // ! Must be the first #include!
#include "XMP_Const.h"
#include "XMP_BuildInfo.h"
#include "XMP_LibUtils.hpp"
#include "public/include/XMP_Environment.h" // ! Must be the first #include!
#include "public/include/XMP_Const.h"
#include "build/XMP_BuildInfo.h"
#include "source/XMP_LibUtils.hpp"

#include "client-glue/WXMP_Common.hpp"
#include "public/include/client-glue/WXMP_Common.hpp"

#include <vector>
#include <string>
#include <map>

#include <cassert>
#include <cstring>
#include <cstdlib>

#if XMP_WinBuild
#pragma warning ( disable : 4244 ) // possible loss of data (temporary for 64 bit builds)
Expand Down Expand Up @@ -78,8 +79,8 @@ extern WXMP_Result void_wResult;

#define kHexDigits "0123456789ABCDEF"

#define XMP_LitMatch(s,l) (std::strcmp((s),(l)) == 0)
#define XMP_LitNMatch(s,l,n) (std::strncmp((s),(l),(n)) == 0)
#define XMP_LitMatch(s,l) (strcmp((s),(l)) == 0)
#define XMP_LitNMatch(s,l,n) (strncmp((s),(l),(n)) == 0)
// *** Use the above macros!

#if XMP_WinBuild
Expand All @@ -101,7 +102,7 @@ extern WXMP_Result void_wResult;
(XMP_API_VERSION_MICRO << 8) )

#define kXMPCoreName "XMP Core"
#define kXMPCore_VersionMessage kXMPCoreName " " XMP_API_VERSION_STRING
#define kXMPCore_VersionMessage kXMPCoreName " " XMPCORE_API_VERSION_STRING
// =================================================================================================
// Support for call tracing

Expand Down Expand Up @@ -226,7 +227,7 @@ static inline bool
IsPathPrefix ( XMP_StringPtr fullPath, XMP_StringPtr prefix )
{
bool isPrefix = false;
XMP_StringLen prefixLen = std::strlen(prefix);
XMP_StringLen prefixLen = strlen(prefix);
if ( XMP_LitNMatch ( prefix, fullPath, prefixLen ) ) {
char separator = fullPath[prefixLen];
if ( (separator == 0) || (separator == '/') ||
Expand Down Expand Up @@ -306,7 +307,7 @@ class XMP_Node {
// *** _valuePtr = value.c_str();
#endif
};

XMP_Node ( XMP_Node * _parent, XMP_StringPtr _name, XMP_StringPtr _value, XMP_OptionBits _options )
: options(_options), name(_name), value(_value), parent(_parent)
{
Expand All @@ -328,23 +329,25 @@ class XMP_Node {
// *** _valuePtr = value.c_str();
#endif
};


void GetLocalURI ( XMP_StringPtr * uriStr, XMP_StringLen * uriSize ) const;

void RemoveChildren()
{
for ( size_t i = 0, vLim = children.size(); i < vLim; ++i ) {
if ( children[i] != 0 ) delete children[i];
}
children.clear();
}

void RemoveQualifiers()
{
for ( size_t i = 0, vLim = qualifiers.size(); i < vLim; ++i ) {
if ( qualifiers[i] != 0 ) delete qualifiers[i];
}
qualifiers.clear();
}

void ClearNode()
{
options = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMPCore_Impl.hpp"
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "XMPCore/source/XMPCore_Impl.hpp"

#include "XMPIterator.hpp"
#include "XMPCore/source/XMPIterator.hpp"

#include <string>
#include <stdio.h> // For snprintf.
Expand Down Expand Up @@ -44,7 +44,6 @@ static XMP_Node * sDummySchema = 0; // ! Used for some ugliness with aliases.
static void
AddSchemaProps ( IterInfo & info, IterNode & iterSchema, const XMP_Node * xmpSchema )
{
info = info; // Avoid unused parameter warning.
#if TraceIterators
printf ( " Adding properties of %s\n", xmpSchema->name.c_str() );
#endif
Expand Down Expand Up @@ -567,9 +566,11 @@ XMPIterator::Next ( XMP_StringPtr * schemaNS,

*propPath = info.currPos->fullPath.c_str();
*pathSize = info.currPos->fullPath.size();

if ( info.options & kXMP_IterJustLeafName ) {
*propPath += info.currPos->leafOffset;
*pathSize -= info.currPos->leafOffset;
xmpNode->GetLocalURI ( schemaNS, nsSize ); // Use the leaf namespace, not the top namespace.
}

if ( ! (*propOptions & kXMP_PropCompositeMask) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// of the Adobe license agreement accompanying it.
// =================================================================================================

#include "XMP_Environment.h"
#include "XMP_Const.h"
#include "XMPMeta.hpp"
#include "public/include/XMP_Environment.h"
#include "public/include/XMP_Const.h"
#include "XMPCore/source/XMPMeta.hpp"

// =================================================================================================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
// one format in a file with a different format', inventors: Sean Parent, Greg Gilley.
// =================================================================================================

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMPCore_Impl.hpp"
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "XMPCore/source/XMPCore_Impl.hpp"

#include "XMPMeta.hpp"
#include "XMPIterator.hpp"
#include "XMPUtils.hpp"
#include "XMPCore/source/XMPMeta.hpp"
#include "XMPCore/source/XMPIterator.hpp"
#include "XMPCore/source/XMPUtils.hpp"

#include "XMP_Version.h"
#include "UnicodeInlines.incl_cpp"
#include "UnicodeConversions.hpp"
#include "ExpatAdapter.hpp"
#include "public/include/XMP_Version.h"
#include "source/UnicodeInlines.incl_cpp"
#include "source/UnicodeConversions.hpp"
#include "source/ExpatAdapter.hpp"

#if XMP_DebugBuild
#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
// one format in a file with a different format', inventors: Sean Parent, Greg Gilley.
// =================================================================================================

#include "XMP_Environment.h" // ! This must be the first include!
#include "XMPCore_Impl.hpp"
#include "public/include/XMP_Environment.h" // ! This must be the first include!
#include "XMPCore/source/XMPCore_Impl.hpp"

#include "XMPMeta.hpp"
#include "XMPUtils.hpp"
#include "XMPCore/source/XMPMeta.hpp"
#include "XMPCore/source/XMPUtils.hpp"

#include "UnicodeInlines.incl_cpp"
#include "UnicodeConversions.hpp"
#include "ExpatAdapter.hpp"
#include "source/UnicodeInlines.incl_cpp"
#include "source/UnicodeConversions.hpp"
#include "source/ExpatAdapter.hpp"

#if XMP_DebugBuild
#include <iostream>
Expand Down

0 comments on commit 81a4c6b

Please sign in to comment.