00001 #ifndef __TXMPFiles_hpp__ 00002 #define __TXMPFiles_hpp__ 1 00003 00004 #if ( ! __XMP_hpp__ ) 00005 #error "Do not directly include, use XMP.hpp" 00006 #endif 00007 00008 // ================================================================================================= 00009 // ADOBE SYSTEMS INCORPORATED 00010 // Copyright 2002 Adobe Systems Incorporated 00011 // All Rights Reserved 00012 // 00013 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms 00014 // of the Adobe license agreement accompanying it. 00015 // ================================================================================================= 00016 00017 // ================================================================================================= 00033 // ================================================================================================= 00034 00035 00036 // ================================================================================================= 00058 // ================================================================================================= 00059 00060 00061 template <class tStringObj> 00062 class TXMPFiles { 00063 00064 public: 00065 00066 // ============================================================================================= 00071 00072 // --------------------------------------------------------------------------------------------- 00079 00080 static void GetVersionInfo ( XMP_VersionInfo * versionInfo ); 00081 00082 // --------------------------------------------------------------------------------------------- 00091 00092 static bool Initialize(); 00093 00094 // --------------------------------------------------------------------------------------------- 00108 00109 static bool Initialize ( XMP_OptionBits options ); 00110 00111 // --------------------------------------------------------------------------------------------- 00118 00119 static void Terminate(); 00120 00122 00123 // ============================================================================================= 00129 00130 // --------------------------------------------------------------------------------------------- 00132 00133 TXMPFiles(); 00134 00135 // --------------------------------------------------------------------------------------------- 00141 00142 virtual ~TXMPFiles() throw(); 00143 00144 // --------------------------------------------------------------------------------------------- 00165 00166 TXMPFiles ( XMP_StringPtr filePath, 00167 XMP_FileFormat format = kXMP_UnknownFile, 00168 XMP_OptionBits openFlags = 0 ); 00169 00170 // --------------------------------------------------------------------------------------------- 00176 00177 TXMPFiles ( const tStringObj & filePath, 00178 XMP_FileFormat format = kXMP_UnknownFile, 00179 XMP_OptionBits openFlags = 0 ); 00180 00181 // --------------------------------------------------------------------------------------------- 00189 00190 TXMPFiles ( const TXMPFiles<tStringObj> & original ); 00191 00192 // --------------------------------------------------------------------------------------------- 00198 00199 void operator= ( const TXMPFiles<tStringObj> & rhs ); 00200 00201 // --------------------------------------------------------------------------------------------- 00212 00213 TXMPFiles ( XMPFilesRef xmpFilesObj ); 00214 00215 // --------------------------------------------------------------------------------------------- 00226 00227 XMPFilesRef GetInternalRef(); 00228 00230 00231 // ============================================================================================= 00237 00238 // --------------------------------------------------------------------------------------------- 00268 00269 00270 static bool GetFormatInfo ( XMP_FileFormat format, 00271 XMP_OptionBits * handlerFlags = 0 ); 00272 00274 00275 // ============================================================================================= 00280 00281 // --------------------------------------------------------------------------------------------- 00292 00293 static XMP_FileFormat CheckFileFormat ( XMP_StringPtr filePath ); 00294 00295 // --------------------------------------------------------------------------------------------- 00309 00310 static XMP_FileFormat CheckPackageFormat ( XMP_StringPtr folderPath ); 00311 00312 // --------------------------------------------------------------------------------------------- 00365 00366 00367 bool OpenFile ( XMP_StringPtr filePath, 00368 XMP_FileFormat format = kXMP_UnknownFile, 00369 XMP_OptionBits openFlags = 0 ); 00370 00371 // --------------------------------------------------------------------------------------------- 00376 00377 bool OpenFile ( const tStringObj & filePath, 00378 XMP_FileFormat format = kXMP_UnknownFile, 00379 XMP_OptionBits openFlags = 0 ); 00380 00381 // --------------------------------------------------------------------------------------------- 00402 00403 void CloseFile ( XMP_OptionBits closeFlags = 0 ); 00404 00405 // --------------------------------------------------------------------------------------------- 00422 00423 bool GetFileInfo ( tStringObj * filePath = 0, 00424 XMP_OptionBits * openFlags = 0, 00425 XMP_FileFormat * format = 0, 00426 XMP_OptionBits * handlerFlags = 0 ); 00427 00428 // --------------------------------------------------------------------------------------------- 00438 00439 void SetAbortProc ( XMP_AbortProc abortProc, 00440 void * abortArg ); 00441 00443 00444 // ============================================================================================= 00451 00452 // --------------------------------------------------------------------------------------------- 00479 00480 bool GetXMP ( SXMPMeta * xmpObj = 0, 00481 tStringObj * xmpPacket = 0, 00482 XMP_PacketInfo * packetInfo = 0 ); 00483 00484 // --------------------------------------------------------------------------------------------- 00492 00493 void PutXMP ( const SXMPMeta & xmpObj ); 00494 00495 // --------------------------------------------------------------------------------------------- 00503 00504 void PutXMP ( const tStringObj & xmpPacket ); 00505 00506 // --------------------------------------------------------------------------------------------- 00517 00518 void PutXMP ( XMP_StringPtr xmpPacket, 00519 XMP_StringLen xmpLength = kXMP_UseNullTermination ); 00520 00521 // --------------------------------------------------------------------------------------------- 00555 00556 bool CanPutXMP ( const SXMPMeta & xmpObj ); 00557 00558 // --------------------------------------------------------------------------------------------- 00566 00567 bool CanPutXMP ( const tStringObj & xmpPacket ); 00568 00569 // --------------------------------------------------------------------------------------------- 00580 00581 bool CanPutXMP ( XMP_StringPtr xmpPacket, 00582 XMP_StringLen xmpLength = kXMP_UseNullTermination ); 00583 00585 00586 // ============================================================================================= 00587 00588 private: 00589 00590 XMPFilesRef xmpFilesRef; 00591 00592 static void SetClientString ( void * clientPtr, XMP_StringPtr valuePtr, XMP_StringLen valueLen ); 00593 00594 }; // class TXMPFiles 00595 00596 // ================================================================================================= 00597 00598 #endif // __TXMPFiles_hpp__