diff options
author | Hubert Figuière <hub@figuiere.net> | 2016-12-07 00:03:00 -0500 |
---|---|---|
committer | Hubert Figuière <hub@figuiere.net> | 2016-12-07 00:04:31 -0500 |
commit | 6071af09b5e263b63e57b28ab8a78484bc65e3fe (patch) | |
tree | 45f97ac82e5582684d889ede0fdacaf2c6eddf2e /XMPCore/source/DOMSerializerImpl.cpp | |
parent | 606a7df73750084a36fe69651e7b672333a76412 (diff) |
Update to XMP SDK CC 2016.07
Diffstat (limited to 'XMPCore/source/DOMSerializerImpl.cpp')
-rw-r--r-- | XMPCore/source/DOMSerializerImpl.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/XMPCore/source/DOMSerializerImpl.cpp b/XMPCore/source/DOMSerializerImpl.cpp new file mode 100644 index 0000000..07da8dc --- /dev/null +++ b/XMPCore/source/DOMSerializerImpl.cpp @@ -0,0 +1,54 @@ +// ================================================================================================= +// ADOBE SYSTEMS INCORPORATED +// Copyright 2015 Adobe Systems Incorporated +// All Rights Reserved +// +// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms +// of the Adobe license agreement accompanying it. +// ================================================================================================= + +#define IMPLEMENTATION_HEADERS_CAN_BE_INCLUDED 1 + #include "XMPCore/ImplHeaders/DOMSerializerImpl.h" + #include "XMPCore/ImplHeaders/ClientDOMSerializerWrapperImpl.h" +#undef IMPLEMENTATION_HEADERS_CAN_BE_INCLUDED + +#include "XMPCommon/Interfaces/IError_I.h" +#include "XMPCore/XMPCoreErrorCodes.h" +#include "XMPCommon/Interfaces/ISharedMutex.h" +#include "XMPCommon/Utilities/AutoSharedLock.h" +#include "XMPCommon/Utilities/TSmartPointers_I.h" + +namespace AdobeXMPCore_Int { + + DOMSerializerImpl::DOMSerializerImpl() + : mSharedMutex( ISharedMutex::CreateSharedMutex() ) { } + + spISharedMutex APICALL DOMSerializerImpl::GetMutex() const { + return mSharedMutex; + } + + spIDOMSerializer APICALL DOMSerializerImpl::Clone() const { + DOMSerializerImpl * cloned = clone(); + if ( cloned ) { + AutoSharedLock lock( mSharedMutex ); + cloned->mTreatKeyAsCaseInsensitiveCharBuffer = mTreatKeyAsCaseInsensitiveCharBuffer; + cloned->mAllowDifferentValueTypesForExistingEntries = mAllowDifferentValueTypesForExistingEntries; + if ( mKeysSet ) + cloned->mKeysSet = new KeysSet( mKeysSet->begin(), mKeysSet->end() ); + + if ( mKeyValueTypeMap ) + cloned->mKeyValueTypeMap = new keyValueTypeMap( mKeyValueTypeMap->begin(), mKeyValueTypeMap->end() ); + + for ( auto it = mMap.begin(), itEnd = mMap.end(); it != itEnd; ++it ) { + cloned->mMap[ it->first ] = it->second; + } + } + return MakeUncheckedSharedPointer( cloned, __FILE__, __LINE__, true ); + } + + AdobeXMPCore::spIDOMSerializer IDOMSerializer_I::CreateDOMSerializer( pIClientDOMSerializer_base clientDOMSerializer ) { + return MakeUncheckedSharedPointer( new ClientDOMSerializerWrapperImpl( clientDOMSerializer ), __FILE__, __LINE__, true ); + } + + +} |