
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-2007 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 // --------------------------------------------------------------------------------------------- 00110 00111 static bool Initialize ( XMP_OptionBits options ); 00112 00113 // --------------------------------------------------------------------------------------------- 00120 00121 static void Terminate(); 00122 00124 00125 // ============================================================================================= 00131 00132 // --------------------------------------------------------------------------------------------- 00134 00135 TXMPFiles(); 00136 00137 // --------------------------------------------------------------------------------------------- 00143 00144 virtual ~TXMPFiles() throw(); 00145 00146 // --------------------------------------------------------------------------------------------- 00169 00170 TXMPFiles ( XMP_StringPtr filePath, 00171 XMP_FileFormat format = kXMP_UnknownFile, 00172 XMP_OptionBits openFlags = 0 ); 00173 00174 // --------------------------------------------------------------------------------------------- 00180 00181 TXMPFiles ( const tStringObj & filePath, 00182 XMP_FileFormat format = kXMP_UnknownFile, 00183 XMP_OptionBits openFlags = 0 ); 00184 00185 // --------------------------------------------------------------------------------------------- 00193 00194 TXMPFiles ( const TXMPFiles<tStringObj> & original ); 00195 00196 // --------------------------------------------------------------------------------------------- 00202 00203 void operator= ( const TXMPFiles<tStringObj> & rhs ); 00204 00205 // --------------------------------------------------------------------------------------------- 00216 00217 TXMPFiles ( XMPFilesRef xmpFilesObj ); 00218 00219 // --------------------------------------------------------------------------------------------- 00230 00231 XMPFilesRef GetInternalRef(); 00232 00234 00235 // ============================================================================================= 00241 00242 // --------------------------------------------------------------------------------------------- 00273 00274 00275 static bool GetFormatInfo ( XMP_FileFormat format, 00276 XMP_OptionBits * handlerFlags = 0 ); 00277 00279 00280 // ============================================================================================= 00285 00286 // --------------------------------------------------------------------------------------------- 00296 00297 static XMP_FileFormat CheckFileFormat ( XMP_StringPtr filePath ); 00298 00299 // --------------------------------------------------------------------------------------------- 00313 00314 static XMP_FileFormat CheckPackageFormat ( XMP_StringPtr folderPath ); 00315 00316 // --------------------------------------------------------------------------------------------- 00371 00372 00373 bool OpenFile ( XMP_StringPtr filePath, 00374 XMP_FileFormat format = kXMP_UnknownFile, 00375 XMP_OptionBits openFlags = 0 ); 00376 00377 // --------------------------------------------------------------------------------------------- 00382 00383 bool OpenFile ( const tStringObj & filePath, 00384 XMP_FileFormat format = kXMP_UnknownFile, 00385 XMP_OptionBits openFlags = 0 ); 00386 00387 // --------------------------------------------------------------------------------------------- 00408 00409 void CloseFile ( XMP_OptionBits closeFlags = 0 ); 00410 00411 // --------------------------------------------------------------------------------------------- 00428 00429 bool GetFileInfo ( tStringObj * filePath = 0, 00430 XMP_OptionBits * openFlags = 0, 00431 XMP_FileFormat * format = 0, 00432 XMP_OptionBits * handlerFlags = 0 ); 00433 00434 // --------------------------------------------------------------------------------------------- 00444 00445 void SetAbortProc ( XMP_AbortProc abortProc, 00446 void * abortArg ); 00447 00449 00450 // ============================================================================================= 00457 00458 // --------------------------------------------------------------------------------------------- 00485 00486 bool GetXMP ( SXMPMeta * xmpObj = 0, 00487 tStringObj * xmpPacket = 0, 00488 XMP_PacketInfo * packetInfo = 0 ); 00489 00490 // --------------------------------------------------------------------------------------------- 00521 00522 bool GetThumbnail ( XMP_ThumbnailInfo * tnailInfo ); 00523 00524 // --------------------------------------------------------------------------------------------- 00532 00533 void PutXMP ( const SXMPMeta & xmpObj ); 00534 00535 // --------------------------------------------------------------------------------------------- 00543 00544 void PutXMP ( const tStringObj & xmpPacket ); 00545 00546 // --------------------------------------------------------------------------------------------- 00557 00558 void PutXMP ( XMP_StringPtr xmpPacket, 00559 XMP_StringLen xmpLength = kXMP_UseNullTermination ); 00560 00561 // --------------------------------------------------------------------------------------------- 00595 00596 bool CanPutXMP ( const SXMPMeta & xmpObj ); 00597 00598 // --------------------------------------------------------------------------------------------- 00606 00607 bool CanPutXMP ( const tStringObj & xmpPacket ); 00608 00609 // --------------------------------------------------------------------------------------------- 00620 00621 bool CanPutXMP ( XMP_StringPtr xmpPacket, 00622 XMP_StringLen xmpLength = kXMP_UseNullTermination ); 00623 00625 00626 // ============================================================================================= 00627 00628 private: 00629 XMPFilesRef xmpFilesRef; 00630 00631 }; // class TXMPFiles 00632 00633 // ================================================================================================= 00634 00635 #endif // __TXMPFiles_hpp__