DocumentationOverviewBuilding ASL Documentation Library Wiki Docs Indices Browse Perforce More InfoRelease NotesWiki Site Search License Success Stories Contributors MediaDownloadPerforce Depots SupportASL SourceForge HomeMailing Lists Discussion Forums Report Bugs Suggest Features Contribute to ASL RSSShort-text newsFull-text news File releases Other Adobe ProjectsAdobe AirAdobe GIL Adobe Labs Adobe Media Gallery Adobe XMP Tamarin project (Mozilla Foundation) Other ResourcesBoostRIAForge SGI STL |
dng_xmp_sdk.h00001 /*****************************************************************************/ 00002 // Copyright 2006-2007 Adobe Systems Incorporated 00003 // All Rights Reserved. 00004 // 00005 // NOTICE: Adobe permits you to use, modify, and distribute this file in 00006 // accordance with the terms of the Adobe license agreement accompanying it. 00007 /*****************************************************************************/ 00008 00009 /* $Id: //mondo/dng_sdk_1_2/dng_sdk/source/dng_xmp_sdk.h#1 $ */ 00010 /* $DateTime: 2008/03/09 14:29:54 $ */ 00011 /* $Change: 431850 $ */ 00012 /* $Author: tknoll $ */ 00013 00014 /*****************************************************************************/ 00015 00016 #ifndef __dng_xmp_sdk__ 00017 #define __dng_xmp_sdk__ 00018 00019 /*****************************************************************************/ 00020 00021 #include "dng_classes.h" 00022 #include "dng_flags.h" 00023 #include "dng_types.h" 00024 00025 /*****************************************************************************/ 00026 00027 extern const char *XMP_NS_TIFF; 00028 extern const char *XMP_NS_EXIF; 00029 extern const char *XMP_NS_PHOTOSHOP; 00030 extern const char *XMP_NS_XAP; 00031 extern const char *XMP_NS_DC; 00032 00033 extern const char *XMP_NS_CRS; 00034 extern const char *XMP_NS_CRSS; 00035 00036 extern const char *XMP_NS_AUX; 00037 00038 extern const char *XMP_NS_IPTC; 00039 00040 extern const char *XMP_NS_CRX; 00041 00042 /*****************************************************************************/ 00043 00044 class dng_xmp_private; 00045 00046 /*****************************************************************************/ 00047 00048 typedef bool (IteratePathsCallback) (const char *ns, 00049 const char *path, 00050 void *callbackData); 00051 00052 /*****************************************************************************/ 00053 00054 struct dng_xmp_namespace 00055 { 00056 const char * fullName; 00057 const char * shortName; 00058 }; 00059 00060 /*****************************************************************************/ 00061 00062 class dng_xmp_sdk 00063 { 00064 00065 private: 00066 00067 dng_xmp_private *fPrivate; 00068 00069 public: 00070 00071 dng_xmp_sdk (); 00072 00073 dng_xmp_sdk (const dng_xmp_sdk &sdk); 00074 00075 virtual ~dng_xmp_sdk (); 00076 00077 static void InitializeSDK (dng_xmp_namespace * extraNamespaces = NULL); 00078 00079 static void TerminateSDK (); 00080 00081 bool HasMeta () const; 00082 00083 void Parse (dng_host &host, 00084 const char *buffer, 00085 uint32 count); 00086 00087 bool Exists (const char *ns, 00088 const char *path) const; 00089 00090 void AppendArrayItem (const char *ns, 00091 const char *arrayName, 00092 const char *itemValue, 00093 bool isBag = true, 00094 bool propIsStruct = false); 00095 00096 int32 CountArrayItems (const char *ns, 00097 const char *path) const; 00098 00099 bool HasNameSpace (const char *ns) const; 00100 00101 void Remove (const char *ns, 00102 const char *path); 00103 00104 void RemoveProperties (const char *ns); 00105 00106 void ComposeArrayItemPath (const char *ns, 00107 const char *arrayName, 00108 int32 itemNumber, 00109 dng_string &s) const; 00110 00111 void ComposeStructFieldPath (const char *ns, 00112 const char *structName, 00113 const char *fieldNS, 00114 const char *fieldName, 00115 dng_string &s) const; 00116 00117 bool GetNamespacePrefix (const char *uri, 00118 dng_string &s) const; 00119 00120 bool GetString (const char *ns, 00121 const char *path, 00122 dng_string &s) const; 00123 00124 bool GetStringList (const char *ns, 00125 const char *path, 00126 dng_string_list &list) const; 00127 00128 bool GetAltLangDefault (const char *ns, 00129 const char *path, 00130 dng_string &s) const; 00131 00132 bool GetStructField (const char *ns, 00133 const char *path, 00134 const char *fieldNS, 00135 const char *fieldName, 00136 dng_string &s) const; 00137 00138 void Set (const char *ns, 00139 const char *path, 00140 const char *text); 00141 00142 void SetString (const char *ns, 00143 const char *path, 00144 const dng_string &s); 00145 00146 void SetStringList (const char *ns, 00147 const char *path, 00148 const dng_string_list &list, 00149 bool isBag); 00150 00151 void SetAltLangDefault (const char *ns, 00152 const char *path, 00153 const dng_string &s); 00154 00155 void SetStructField (const char *ns, 00156 const char *path, 00157 const char *fieldNS, 00158 const char *fieldName, 00159 const char *text); 00160 00161 void DeleteStructField (const char *ns, 00162 const char *structName, 00163 const char *fieldNS, 00164 const char *fieldName); 00165 00166 dng_memory_block * Serialize (dng_memory_allocator &allocator, 00167 bool asPacket, 00168 uint32 targetBytes, 00169 uint32 padBytes, 00170 bool forJPEG) const; 00171 00172 void AppendXMP (const dng_xmp_sdk *xmp); 00173 00174 void ReplaceXMP (dng_xmp_sdk *xmp); 00175 00176 bool IteratePaths (IteratePathsCallback *callback, 00177 void *callbackData = NULL, 00178 const char *startNS = 0, 00179 const char *startingPath = 0); 00180 00181 private: 00182 00183 void ClearMeta (); 00184 00185 void MakeMeta (); 00186 00187 void NeedMeta (); 00188 00189 // Hidden assignment operator. 00190 00191 dng_xmp_sdk & operator= (const dng_xmp_sdk &sdk); 00192 00193 }; 00194 00195 /*****************************************************************************/ 00196 00197 #endif 00198 00199 /*****************************************************************************/ | |||
