xmp_toolkit_ruby 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. checksums.yaml +7 -0
  2. data/.idea/.gitignore +8 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +88 -0
  5. data/.ruby-gemset +1 -0
  6. data/.ruby-version +1 -0
  7. data/AGENTS.md +72 -0
  8. data/CHANGELOG.md +45 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +287 -0
  11. data/Rakefile +25 -0
  12. data/cliff.toml +138 -0
  13. data/docker/Dockerfile +87 -0
  14. data/docker/ProductConfig.cmake.patch +11 -0
  15. data/docker/ToolchainGCC.cmake.patch +11 -0
  16. data/exe/xmp_toolkit_ruby +8 -0
  17. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/LICENSE +31 -0
  18. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/build/XMP_BuildInfo.h +17 -0
  19. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/TXMPFiles.hpp +853 -0
  20. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/TXMPIterator.hpp +234 -0
  21. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/TXMPMeta.hpp +1753 -0
  22. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/TXMPUtils.hpp +967 -0
  23. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMP.hpp +98 -0
  24. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMP.incl_cpp +69 -0
  25. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/BaseInterfaces/IConfigurable.h +225 -0
  26. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/BaseInterfaces/ISharedObject.h +71 -0
  27. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/BaseInterfaces/IThreadSafe.h +76 -0
  28. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/BaseInterfaces/IVersionable.h +71 -0
  29. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/IConfigurationManager.h +167 -0
  30. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/IError.h +377 -0
  31. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/IErrorNotifier.h +52 -0
  32. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/IMemoryAllocator.h +65 -0
  33. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/IObjectFactory.h +90 -0
  34. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Interfaces/IUTF8String.h +504 -0
  35. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Utilities/TWrapperFunctions.h +252 -0
  36. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/Utilities/TWrapperFunctions2.h +564 -0
  37. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/XMPCommonDefines.h +194 -0
  38. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/XMPCommonErrorCodes.h +114 -0
  39. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/XMPCommonFwdDeclarations.h +158 -0
  40. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/XMPCommonLatestInterfaceVersions.h +51 -0
  41. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/source/IConfigurable.cpp +204 -0
  42. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/source/IConfigurationManager.cpp +92 -0
  43. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/source/IError.cpp +207 -0
  44. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/source/IErrorNotifier.cpp +26 -0
  45. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCommon/source/IUTF8String.cpp +299 -0
  46. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IArrayNode.h +303 -0
  47. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IClientDOMParser.h +88 -0
  48. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IClientDOMSerializer.h +94 -0
  49. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/ICompositeNode.h +331 -0
  50. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/ICoreConfigurationManager.h +107 -0
  51. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/ICoreObjectFactory.h +279 -0
  52. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IDOMImplementationRegistry.h +150 -0
  53. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IDOMParser.h +181 -0
  54. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IDOMSerializer.h +120 -0
  55. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IMetadata.h +145 -0
  56. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IMetadataConverterUtils.h +116 -0
  57. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/INameSpacePrefixMap.h +236 -0
  58. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/INode.h +582 -0
  59. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/INodeIterator.h +193 -0
  60. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IPath.h +212 -0
  61. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IPathSegment.h +225 -0
  62. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/ISimpleNode.h +150 -0
  63. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/Interfaces/IStructureNode.h +306 -0
  64. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/XMPCoreDefines.h +94 -0
  65. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/XMPCoreErrorCodes.h +116 -0
  66. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/XMPCoreFwdDeclarations.h +325 -0
  67. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/XMPCoreLatestInterfaceVersions.h +97 -0
  68. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IArrayNode.cpp +163 -0
  69. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IClientDOMParser.cpp +76 -0
  70. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IClientDOMSerializer.cpp +73 -0
  71. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/ICompositeNode.cpp +121 -0
  72. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/ICoreConfigurationManager.cpp +88 -0
  73. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/ICoreObjectFactory.cpp +83 -0
  74. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IDOMImplementationRegistry.cpp +122 -0
  75. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IDOMParser.cpp +116 -0
  76. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IDOMSerializer.cpp +109 -0
  77. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IMetadata.cpp +113 -0
  78. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IMetadataConverterUtils.cpp +92 -0
  79. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/INameSpacePrefixMap.cpp +187 -0
  80. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/INode.cpp +377 -0
  81. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/INodeIterator.cpp +105 -0
  82. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IPath.cpp +157 -0
  83. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IPathSegment.cpp +146 -0
  84. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/ISimpleNode.cpp +111 -0
  85. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMPCore/source/IStructureNode.cpp +104 -0
  86. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMP_Const.h +1590 -0
  87. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMP_Environment.h +223 -0
  88. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMP_IO.hpp +169 -0
  89. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/XMP_Version.h +52 -0
  90. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/TXMPFiles.incl_cpp +484 -0
  91. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/TXMPIterator.incl_cpp +223 -0
  92. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/TXMPMeta.incl_cpp +917 -0
  93. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/TXMPUtils.incl_cpp +445 -0
  94. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/WXMPFiles.hpp +281 -0
  95. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/WXMPIterator.hpp +74 -0
  96. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/WXMPMeta.hpp +635 -0
  97. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/WXMPUtils.hpp +314 -0
  98. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/include/client-glue/WXMP_Common.hpp +132 -0
  99. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/libraries/i80386linux_x64/debug/libXMPCore.so +0 -0
  100. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/libraries/i80386linux_x64/debug/libXMPCoreStatic.a +0 -0
  101. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/libraries/i80386linux_x64/debug/libXMPFiles.so +0 -0
  102. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/libraries/i80386linux_x64/debug/libXMPFilesStatic.a +0 -0
  103. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/libraries/macintosh/universal/Debug/libXMPCoreStatic.a +0 -0
  104. data/ext/xmp_toolkit_ruby/XMP-Toolkit-SDK/public/libraries/macintosh/universal/Debug/libXMPFilesStatic.a +0 -0
  105. data/ext/xmp_toolkit_ruby/extconf.rb +101 -0
  106. data/ext/xmp_toolkit_ruby/xmp_toolkit.cpp +321 -0
  107. data/ext/xmp_toolkit_ruby/xmp_toolkit.hpp +69 -0
  108. data/ext/xmp_toolkit_ruby/xmp_toolkit_ruby.cpp +44 -0
  109. data/lib/xmp_toolkit_ruby/cli.rb +95 -0
  110. data/lib/xmp_toolkit_ruby/namespaces.rb +77 -0
  111. data/lib/xmp_toolkit_ruby/plugins/LICENSE +31 -0
  112. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux/PDF_Handler.resources/MODULE_IDENTIFIER.txt +1 -0
  113. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux/PDF_Handler.resources/XMPPLUGINUIDS.txt +31 -0
  114. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux/PDF_Handler.xpi +0 -0
  115. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux/libMiniPDFL.so +0 -0
  116. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux_x64/PDF_Handler.resources/MODULE_IDENTIFIER.txt +1 -0
  117. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux_x64/PDF_Handler.resources/XMPPLUGINUIDS.txt +31 -0
  118. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux_x64/PDF_Handler.xpi +0 -0
  119. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/i80386linux/i80386linux_x64/libMiniPDFL.so +0 -0
  120. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/PDF_Handler +0 -0
  121. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/Info.plist +52 -0
  122. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MODULE_IDENTIFIER.txt +1 -0
  123. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/MiniPDFL +0 -0
  124. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Resources/English.lproj/InfoPlist.strings +0 -0
  125. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Resources/Info.plist +35 -0
  126. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/A/MiniPDFL +0 -0
  127. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings +0 -0
  128. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/A/Resources/Info.plist +35 -0
  129. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/A/_CodeSignature/CodeResources +146 -0
  130. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/Current/MiniPDFL +0 -0
  131. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/Current/Resources/English.lproj/InfoPlist.strings +0 -0
  132. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/Current/Resources/Info.plist +35 -0
  133. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/MiniPDFL.framework/Versions/Current/_CodeSignature/CodeResources +146 -0
  134. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Resources/XMPPLUGINUIDS.txt +31 -0
  135. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/PDF_Handler +0 -0
  136. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/Info.plist +52 -0
  137. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MODULE_IDENTIFIER.txt +1 -0
  138. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/MiniPDFL +0 -0
  139. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Resources/English.lproj/InfoPlist.strings +0 -0
  140. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Resources/Info.plist +35 -0
  141. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/MiniPDFL +0 -0
  142. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings +0 -0
  143. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/Resources/Info.plist +35 -0
  144. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/A/_CodeSignature/CodeResources +146 -0
  145. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/Current/MiniPDFL +0 -0
  146. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/Current/Resources/English.lproj/InfoPlist.strings +0 -0
  147. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/Current/Resources/Info.plist +35 -0
  148. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/MiniPDFL.framework/Versions/Current/_CodeSignature/CodeResources +146 -0
  149. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/Resources/XMPPLUGINUIDS.txt +31 -0
  150. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/A/_CodeSignature/CodeResources +216 -0
  151. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/PDF_Handler +0 -0
  152. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/Info.plist +52 -0
  153. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MODULE_IDENTIFIER.txt +1 -0
  154. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/MiniPDFL +0 -0
  155. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Resources/English.lproj/InfoPlist.strings +0 -0
  156. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Resources/Info.plist +35 -0
  157. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/A/MiniPDFL +0 -0
  158. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/A/Resources/English.lproj/InfoPlist.strings +0 -0
  159. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/A/Resources/Info.plist +35 -0
  160. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/A/_CodeSignature/CodeResources +146 -0
  161. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/Current/MiniPDFL +0 -0
  162. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/Current/Resources/English.lproj/InfoPlist.strings +0 -0
  163. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/Current/Resources/Info.plist +35 -0
  164. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/MiniPDFL.framework/Versions/Current/_CodeSignature/CodeResources +146 -0
  165. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/Resources/XMPPLUGINUIDS.txt +31 -0
  166. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/macintosh/universal/PDF_Handler.xpi/Versions/Current/_CodeSignature/CodeResources +216 -0
  167. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/linux/PDF_Handler.exp +11 -0
  168. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/mac/PDF_Handler.exp +2 -0
  169. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/mac/PDF_Handler.plist +28 -0
  170. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/mac/PDF_HandlerPList.h +12 -0
  171. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/win/CopyPDFL.bat +14 -0
  172. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/win/PDF_Handler-32.rc +8 -0
  173. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/win/PDF_Handler-64.rc +8 -0
  174. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/resource/win/PDF_Handler.def +9 -0
  175. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/windows/windows_x64/MiniPDFL.dll +0 -0
  176. data/lib/xmp_toolkit_ruby/plugins/PDF_Handler/windows/windows_x64/PDF_Handler.xpi +0 -0
  177. data/lib/xmp_toolkit_ruby/version.rb +5 -0
  178. data/lib/xmp_toolkit_ruby/xmp_file_format.rb +87 -0
  179. data/lib/xmp_toolkit_ruby/xmp_file_handler_flags.rb +49 -0
  180. data/lib/xmp_toolkit_ruby.rb +237 -0
  181. data/sig/xmp_toolkit_ruby.rbs +4 -0
  182. data/tasks/changelog.rake +29 -0
  183. metadata +357 -0
@@ -0,0 +1,853 @@
1
+ #ifndef __TXMPFiles_hpp__
2
+ #define __TXMPFiles_hpp__ 1
3
+
4
+ #if ( ! __XMP_hpp__ )
5
+ #error "Do not directly include, use XMP.hpp"
6
+ #endif
7
+
8
+ // =================================================================================================
9
+ // Copyright Adobe
10
+ // Copyright 2002 Adobe
11
+ // All Rights Reserved
12
+ //
13
+ // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
14
+ // of the Adobe license agreement accompanying it.
15
+ // =================================================================================================
16
+
17
+ // =================================================================================================
18
+ /// \file TXMPFiles.hpp
19
+ /// \brief API for access to the main (document-level) metadata in a file_.
20
+ ///
21
+ /// The Adobe XMP Toolkit's file handling component, XMPFiles, is a front end to a set of
22
+ /// format-specific file handlers that support file I/O for XMP. The file handlers implement smart,
23
+ /// efficient support for those file formats for which the means to embed XMP is defined in the XMP
24
+ /// Specification. Where possible, this support allows:
25
+ /// \li Injection of XMP where none currently exists
26
+ /// \li Expansion of XMP without regard to existing padding
27
+ /// \li Reconciliation of the XMP and other legacy forms of metadata.
28
+ ///
29
+ /// \c TXMPFiles is designed for use by clients interested in the metadata and not in the primary
30
+ /// file content; the Adobe Bridge application is a typical example. \c TXMPFiles is not intended to
31
+ /// be appropriate for files authored by an application; that is, those files for which the
32
+ /// application has explicit knowledge of the file format.
33
+ // =================================================================================================
34
+
35
+
36
+ // =================================================================================================
37
+ /// \class TXMPFiles TXMPFiles.hpp
38
+ /// \brief API for access to the main (document-level) metadata in a file.
39
+ ///
40
+ /// \c TXMPFiles is a template class that provides the API for the Adobe XMP Toolkit's XMPFiles
41
+ /// component. This provides convenient access to the main, or document level, XMP for a file. Use
42
+ /// it to obtain metadata from a file, which you can then manipulate with the XMP Core component
43
+ /// (the classes \c TXMPMeta, \c TXMPUtils, and \c TXMPIterator); and to write new or changed
44
+ /// metadata back out to a file.
45
+ ///
46
+ /// The functions allow you to open a file, read and write the metadata, then close the file.
47
+ /// While open, portions of the file might be maintained in RAM data structures. Memory
48
+ /// usage can vary considerably depending onfile format and access options.
49
+ ///
50
+ /// A file can be opened for read-only or read-write access, with typical exclusion for both
51
+ /// modes. Errors result in the throw of an \c XMPError exception.
52
+ ///
53
+ /// \c TXMPFiles is the template class. It must be instantiated with a string class such as
54
+ /// \c std::string. Read the Toolkit Overview for information about the overall architecture of the XMP
55
+ /// API, and the documentation for \c XMP.hpp for specific instantiation instructions.
56
+ ///
57
+ /// Access these functions through the concrete class, \c SXMPFiles.
58
+ // =================================================================================================
59
+
60
+
61
+ #if XMP_StaticBuild // ! Client XMP_IO objects can only be used in static builds.
62
+ #include "XMP_IO.hpp"
63
+ #endif
64
+
65
+
66
+ template <class tStringObj>
67
+ class TXMPFiles {
68
+
69
+ public:
70
+
71
+ // =============================================================================================
72
+ /// \name Initialization and termination
73
+ /// @{
74
+ ///
75
+ /// A \c TXMPFiles object must be initialized before use and can be terminated when done.
76
+
77
+ // ---------------------------------------------------------------------------------------------
78
+ /// @brief \c GetVersionInfo() retrieves version information for the XMPFiles component.
79
+ ///
80
+ /// Can be called before \c #Initialize(). This function is static; make the call directly from
81
+ /// the concrete class (\c SXMPFiles).
82
+ ///
83
+ /// @param versionInfo [out] A buffer in which to return the version information.
84
+
85
+ static void GetVersionInfo ( XMP_VersionInfo * versionInfo );
86
+
87
+ // ---------------------------------------------------------------------------------------------
88
+ /// @brief Initializes the XMPFiles library; must be called before creating an \c SXMPFiles object.
89
+ ///
90
+ /// The main action is to activate the available smart file handlers. Must be called before
91
+ /// using any methods except \c GetVersionInfo().
92
+ ///
93
+ /// This function is static; make the call directly from the concrete class (\c SXMPFiles).
94
+ ///
95
+ /// @return True on success.
96
+
97
+ static bool Initialize();
98
+
99
+ // ---------------------------------------------------------------------------------------------
100
+ /// @brief Initializes the XMPFiles library; must be called before creating an \c SXMPFiles object.
101
+ ///
102
+ /// This overload of TXMPFiles::Initialize() accepts option bits to customize the initialization
103
+ /// actions. At this time no option is defined.
104
+ ///
105
+ /// The main action is to activate the available smart file handlers. Must be called before
106
+ /// using any methods except \c GetVersionInfo().
107
+ ///
108
+ /// This function is static; make the call directly from the concrete class (\c SXMPFiles).
109
+ ///
110
+ /// @param options Option flags to control the initialization actions.
111
+ ///
112
+ /// @return True on success.
113
+
114
+ static bool Initialize ( XMP_OptionBits options );
115
+
116
+ // ---------------------------------------------------------------------------------------------
117
+ /// @brief Initializes the XMPFiles library; must be called before creating an \c SXMPFiles object.
118
+ ///
119
+ /// This overload of TXMPFiles::Initialize() accepts plugin directory and name of the plug-ins
120
+ /// as a comma separated list to load the file handler plug-ins. If plugins == NULL, then all
121
+ /// plug-ins present in the plug-in directory will be loaded.
122
+ ///
123
+ /// The main action is to activate the available smart file handlers. Must be called before
124
+ /// using any methods except \c GetVersionInfo().
125
+ ///
126
+ /// This function is static; make the call directly from the concrete class (\c SXMPFiles).
127
+ ///
128
+ /// @param pluginFolder Pugin directorty to load the file handler plug-ins.
129
+ /// @param plugins Comma sepearted list of plug-ins which should be loaded from the plug-in directory.
130
+ /// If plugin == NULL, then all plug-ins availbale in the plug-in directory will be loaded.
131
+ ///
132
+ /// @return True on success.
133
+
134
+ static bool Initialize ( const char* pluginFolder, const char* plugins = NULL );
135
+
136
+ // ---------------------------------------------------------------------------------------------
137
+ /// @brief Initializes the XMPFiles library; must be called before creating an \c SXMPFiles object.
138
+ ///
139
+ /// This overload of TXMPFiles::Initialize( XMP_OptionBits options ) accepts plugin directory and
140
+ /// name of the plug-ins as a comma separated list to load the file handler plug-ins.
141
+ /// If plugins == NULL, then all plug-ins present in the plug-in directory will be loaded.
142
+ ///
143
+ /// The main action is to activate the available smart file handlers. Must be called before
144
+ /// using any methods except \c GetVersionInfo().
145
+ ///
146
+ /// This function is static; make the call directly from the concrete class (\c SXMPFiles).
147
+ ///
148
+ /// @param options Option flags to control the initialization actions.
149
+ /// @param pluginFolder Pugin directorty to load the file handler plug-ins.
150
+ /// @param plugins Comma sepearted list of plug-ins which should be loaded from the plug-in directory.
151
+ /// If plugin == NULL, then all plug-ins availbale in the plug-in directory will be loaded.
152
+ ///
153
+ /// @return True on success.
154
+
155
+ static bool Initialize ( XMP_OptionBits options, const char* pluginFolder, const char* plugins = NULL );
156
+
157
+ // ---------------------------------------------------------------------------------------------
158
+ /// @brief Terminates use of the XMPFiles library.
159
+ ///
160
+ /// Optional. Deallocates global data structures created by intialization. Its main action is to
161
+ /// deallocate heap-allocated global storage, for the benefit of client leak checkers.
162
+ ///
163
+ /// This function is static; make the call directly from the concrete class (\c SXMPFiles).
164
+
165
+ static void Terminate();
166
+
167
+ /// @}
168
+
169
+ // =============================================================================================
170
+ /// \name Constructors and destructor
171
+ /// @{
172
+ ///
173
+ /// The default constructor initializes an object that is associated with no file. The alternate
174
+ /// constructors call \c OpenFile().
175
+
176
+ // ---------------------------------------------------------------------------------------------
177
+ /// @brief Default constructor initializes an object that is associated with no file.
178
+
179
+ TXMPFiles();
180
+
181
+ // ---------------------------------------------------------------------------------------------
182
+ /// @brief Destructor; typical virtual destructor.
183
+ ///
184
+ /// The destructor does not call \c CloseFile(); pending updates are lost when the destructor is run.
185
+ ///
186
+ /// @see \c OpenFile(), \c CloseFile()
187
+
188
+ virtual ~TXMPFiles() throw();
189
+
190
+ // ---------------------------------------------------------------------------------------------
191
+ /// @brief Alternate constructor associates the new \c XMPFiles object with a specific file.
192
+ ///
193
+ /// Calls \c OpenFile() to open the specified file after performing a default construct.
194
+ ///
195
+ /// @param filePath The path for the file, specified as a nul-terminated UTF-8 string.
196
+ ///
197
+ /// @param format A format hint for the file, if known.
198
+ ///
199
+ /// @param openFlags Options for how the file is to be opened (for read or read/write, for
200
+ /// example). Use a logical OR of these bit-flag constants:
201
+ ///
202
+ /// \li \c #kXMPFiles_OpenForRead
203
+ /// \li \c #kXMPFiles_OpenForUpdate
204
+ /// \li \c #kXMPFiles_OpenOnlyXMP
205
+ /// \li \c #kXMPFiles_OpenStrictly
206
+ /// \li \c #kXMPFiles_OpenUseSmartHandler
207
+ /// \li \c #kXMPFiles_OpenUsePacketScanning
208
+ /// \li \c #kXMPFiles_OpenLimitedScanning
209
+ ///
210
+
211
+ TXMPFiles ( XMP_StringPtr filePath,
212
+ XMP_FileFormat format = kXMP_UnknownFile,
213
+ XMP_OptionBits openFlags = 0 );
214
+
215
+ // ---------------------------------------------------------------------------------------------
216
+ /// @brief Alternate constructor associates the new \c XMPFiles object with a specific file,
217
+ /// using a string object.
218
+ ///
219
+ /// Overloads the basic form of the function, allowing you to pass a string object
220
+ /// for the file path. It is otherwise identical; see details in the canonical form.
221
+
222
+ TXMPFiles ( const tStringObj & filePath,
223
+ XMP_FileFormat format = kXMP_UnknownFile,
224
+ XMP_OptionBits openFlags = 0 );
225
+
226
+ // ---------------------------------------------------------------------------------------------
227
+ /// @brief Copy constructor
228
+ ///
229
+ /// Increments an internal reference count but does not perform a deep copy.
230
+ ///
231
+ /// @param original The existing \c TXMPFiles object to copy.
232
+ ///
233
+
234
+ TXMPFiles ( const TXMPFiles<tStringObj> & original );
235
+
236
+ // ---------------------------------------------------------------------------------------------
237
+ /// @brief Assignment operator
238
+ ///
239
+ /// Increments an internal reference count but does not perform a deep copy.
240
+ ///
241
+ /// @param rhs The existing \c TXMPFiles object.
242
+
243
+ void operator= ( const TXMPFiles<tStringObj> & rhs );
244
+
245
+ // ---------------------------------------------------------------------------------------------
246
+ /// @brief Reconstructs a \c TXMPFiles object from an internal reference.
247
+ ///
248
+ /// This constructor creates a new \c TXMPFiles object that refers to the underlying reference
249
+ /// object of an existing \c TXMPFiles object. Use to safely pass \c SXMPFiles references across
250
+ /// DLL boundaries.
251
+ ///
252
+ /// @param xmpFilesObj The underlying reference object, obtained from some other XMP object
253
+ /// with \c TXMPFiles::GetInternalRef().
254
+ ///
255
+
256
+
257
+ TXMPFiles ( XMPFilesRef xmpFilesObj );
258
+
259
+ // ---------------------------------------------------------------------------------------------
260
+ /// @brief GetInternalRef() retrieves an internal reference that can be safely passed across DLL
261
+ /// boundaries and reconstructed.
262
+ ///
263
+ /// Use with the reconstruction constructor to safely pass \c SXMPFiles references across DLL
264
+ /// boundaries where the clients might have used different string types when instantiating
265
+ /// \c TXMPFiles.
266
+ ///
267
+ /// @return The internal reference.
268
+ ///
269
+ /// @see \c TXMPMeta::GetInternalRef() for usage.
270
+
271
+ XMPFilesRef GetInternalRef();
272
+
273
+ /// @}
274
+
275
+ // =============================================================================================
276
+ /// \name File handler information
277
+ /// @{
278
+ ///
279
+ /// Call this static function from the concrete class, \c SXMPFiles, to obtain information about
280
+ /// the file handlers for the XMPFiles component.
281
+
282
+ // ---------------------------------------------------------------------------------------------
283
+ /// @brief GetFormatInfo() reports what features are supported for a specific file format.
284
+ ///
285
+ /// The file handlers for different file formats vary considerably in what features they
286
+ /// support. Support depends on both the general capabilities of the format and the
287
+ /// implementation of the handler for that format.
288
+ ///
289
+ ///This function is static; make the call directly from the concrete class (\c SXMPFiles).
290
+ ///
291
+ /// @param format The file format whose support flags are desired.
292
+ ///
293
+ /// @param handlerFlags [out] A buffer in which to return a logical OR of option bit flags.
294
+ /// The following constants are defined:
295
+ ///
296
+ /// \li \c #kXMPFiles_CanInjectXMP - Can inject first-time XMP into an existing file.
297
+ /// \li \c #kXMPFiles_CanExpand - Can expand XMP or other metadata in an existing file.
298
+ /// \li \c #kXMPFiles_CanRewrite - Can copy one file to another, writing new metadata (as in SaveAs)
299
+ /// \li \c #kXMPFiles_CanReconcile - Supports reconciliation between XMP and other forms.
300
+ /// \li \c #kXMPFiles_AllowsOnlyXMP - Allows access to just the XMP, ignoring other forms.
301
+ /// This is only meaningful if \c #kXMPFiles_CanReconcile is set.
302
+ /// \li \c #kXMPFiles_ReturnsRawPacket - File handler returns raw XMP packet information and string.
303
+ ///
304
+ /// Even if \c #kXMPFiles_ReturnsRawPacket is set, the returned packet information might have an
305
+ /// offset of -1 to indicate an unknown offset. While all file handlers should be able to return
306
+ /// the raw packet, some might not know the offset of the packet within the file. This is
307
+ /// typical in cases where external libraries are used. These cases might not even allow return
308
+ /// of the raw packet.
309
+ ///
310
+ /// @return True if the format has explicit "smart" support, false if the format is handled by
311
+ /// the default packet scanning plus heuristics. */
312
+
313
+
314
+ static bool GetFormatInfo ( XMP_FileFormat format,
315
+ XMP_OptionBits * handlerFlags = 0 );
316
+
317
+ /// @}
318
+
319
+ // =============================================================================================
320
+ /// \name File operations
321
+ /// @{
322
+ ///
323
+ /// These functions allow you to open, close, and query files.
324
+
325
+ // ---------------------------------------------------------------------------------------------
326
+ /// @brief \c CheckFileFormat() tries to determine the format of a file.
327
+ ///
328
+ /// Tries to determine the format of a file, returning an \c #XMP_FileFormat value. Uses the
329
+ /// same logic as \c OpenFile() to select a smart handler.
330
+ ///
331
+ /// @param filePath The path for the file, appropriate for the local operating system. Passed as
332
+ /// a nul-terminated UTF-8 string. The path is the same as would be passed to \c OpenFile.
333
+ ///
334
+ /// @return The file's format if a smart handler would be selected by \c OpenFile(), otherwise
335
+ /// \c #kXMP_UnknownFile.
336
+
337
+ static XMP_FileFormat CheckFileFormat ( XMP_StringPtr filePath );
338
+
339
+ // ---------------------------------------------------------------------------------------------
340
+ /// @brief \c CheckPackageFormat() tries to determine the format of a "package" folder.
341
+ ///
342
+ /// Tries to determine the format of a package, given the name of the top-level folder. Returns
343
+ /// an \c #XMP_FileFormat value. Examples of recognized packages include the video formats P2,
344
+ /// XDCAM, or Sony HDV. These packages contain collections of "clips", stored as multiple files
345
+ /// in specific subfolders.
346
+ ///
347
+ /// @param folderPath The path for the top-level folder, appropriate for the local operating
348
+ /// system. Passed as a nul-terminated UTF-8 string. This is not the same path you would pass to
349
+ /// \c OpenFile(). For example, the top-level path for a package might be ".../MyMovie", while
350
+ /// the path to a file you wish to open would be ".../MyMovie/SomeClip".
351
+ ///
352
+ /// @return The package's format if it can be determined, otherwise \c #kXMP_UnknownFile.
353
+
354
+ static XMP_FileFormat CheckPackageFormat ( XMP_StringPtr folderPath );
355
+
356
+ // ---------------------------------------------------------------------------------------------
357
+ /// @brief \c GetFileModDate() returns the last modification date of all files that are returned
358
+ /// by \c GetAssociatedResources()
359
+ ///
360
+ /// Returns the most recent O/S file modification date of all associated files. In the typical case
361
+ /// of a single file containing embedded XMP, returned date value is the modification date of the
362
+ /// same file. For sidecar and folder based video packages, returned date value is the modification
363
+ /// date of that associated file which was updated last.
364
+ ///
365
+ /// @param filePath A path exactly as would be passed to \c OpenFile.
366
+ ///
367
+ /// @param modDate A required pointer to return the last modification date.
368
+ ///
369
+ /// @param format A format hint as would be passed to \c OpenFile.
370
+ ///
371
+ /// @param options An optional set of option flags. The only defined one is \c kXMPFiles_ForceGivenHandler,
372
+ /// used to shortcut the handler selection logic if the caller is certain of the format.
373
+ ///
374
+ /// @return Returns true if the file path is valid to select a smart handler, false for an
375
+ /// invalid path or if fallback packet scanning would be selected.
376
+
377
+ static bool GetFileModDate ( XMP_StringPtr filePath,
378
+ XMP_DateTime * modDate,
379
+ XMP_FileFormat * format = 0,
380
+ XMP_OptionBits options = 0 );
381
+
382
+
383
+ // ---------------------------------------------------------------------------------------------
384
+ /// @brief \c GetAssociatedResources() returns a list of files and folders associated to filePath.
385
+ ///
386
+ /// \c GetAssociatedResources is provided to locate all files that are associated to the given
387
+ /// filePath such as sidecar-based XMP or folder-based video packages.If a smart
388
+ /// handler can be selected (not fallback packet scanning) then a list of file/folder paths is
389
+ /// returned for the related files that can be safely copied/imported to a different location,
390
+ /// keeping intact metadata(XMP and non-XMP),content and the necessary folder structure of the
391
+ /// format. The necessary folder structure here is the structure that is needed to uniquely
392
+ /// identify a folder-based format.The filePath and format parameters are exactly as would be
393
+ /// used for OpenFile. In the simple embedded XMP case just one path is returned. In the simple
394
+ /// sidecar case one or two paths will be returned, one if there is no sidecar XMP and two if
395
+ /// sidecar XMP exists. For folder-based handlers paths to all associated files is returned,
396
+ /// including the files and folders necessary to identify the format.In general, all the returned
397
+ /// paths are existent.In case of folder based video formats the first associated resource in the
398
+ /// resourceList is the root folder.
399
+ ///
400
+ /// @param filePath A path exactly as would be passed to \c OpenFile.
401
+ ///
402
+ /// @param resourceList Address of a vector of strings to receive all associated resource paths.
403
+ ///
404
+ /// @param format A format hint as would be passed to \c OpenFile.
405
+ ///
406
+ /// @param options An optional set of option flags. The only defined one is \c kXMPFiles_ForceGivenHandler,
407
+ /// used to shortcut the handler selection logic if the caller is certain of the format.
408
+ ///
409
+ /// @return Returns true if the file path is valid to select a smart handler, false for an
410
+ /// invalid path or if fallback packet scanning would be selected. Can also return false for
411
+ /// unexpected errors that prevent knowledge of the file usage.
412
+
413
+ static bool GetAssociatedResources ( XMP_StringPtr filePath,
414
+ std::vector<tStringObj>* resourceList,
415
+ XMP_FileFormat format = kXMP_UnknownFile,
416
+ XMP_OptionBits options = 0);
417
+
418
+ // ---------------------------------------------------------------------------------------------
419
+ /// @brief \c IsMetadataWritable() returns true if metadata can be updated for the given media path.
420
+ ///
421
+ /// \c IsMetadataWritable is provided to check if metadata can be updated or written to the format.In
422
+ /// the case of folder-based video formats only if all the metadata files can be written to, true is
423
+ /// returned.In other words, false is returned for a partial-write state of metadata files in
424
+ /// folder-based media formats.
425
+ ///
426
+ /// @param filePath A path exactly as would be passed to \c OpenFile.
427
+ ///
428
+ /// @param writable A pointer to the result flag. Is true if the metadata can be updated in the format,
429
+ /// otherwise false.
430
+ ///
431
+ /// @param format A format hint as would be passed to \c OpenFile.
432
+ ///
433
+ /// @param options An optional set of option flags. The only defined one is \c kXMPFiles_ForceGivenHandler,
434
+ /// used to shortcut the handler selection logic if the caller is certain of the format.
435
+ ///
436
+ /// @return Returns true if the file path is valid to select a smart handler, false for an
437
+ /// invalid path or if fallback packet scanning would be selected.
438
+
439
+ static bool IsMetadataWritable (XMP_StringPtr filePath,
440
+ bool * writable,
441
+ XMP_FileFormat format = kXMP_UnknownFile,
442
+ XMP_OptionBits options = 0 );
443
+
444
+ // ---------------------------------------------------------------------------------------------
445
+ /// @brief \c OpenFile() opens a file for metadata access.
446
+ ///
447
+ /// Opens a file for the requested forms of metadata access. Opening the file at a minimum
448
+ /// causes the raw XMP packet to be read from the file. If the file handler supports legacy
449
+ /// metadata reconciliation then legacy metadata is also read, unless \c #kXMPFiles_OpenOnlyXMP
450
+ /// is passed.
451
+ ///
452
+ /// If the file is opened for read-only access (passing \c #kXMPFiles_OpenForRead), the disk
453
+ /// file is closed immediately after reading the data from it; the \c XMPFiles object, however,
454
+ /// remains in the open state. You must call \c CloseFile() when finished using it. Other
455
+ /// methods, such as \c GetXMP(), can only be used between the \c OpenFile() and \c CloseFile()
456
+ /// calls. The \c XMPFiles destructor does not call \c CloseFile(); if you call it without
457
+ /// closing, any pending updates are lost.
458
+ ///
459
+ /// If the file is opened for update (passing \c #kXMPFiles_OpenForUpdate), the disk file
460
+ /// remains open until \c CloseFile() is called. The disk file is only updated once, when
461
+ /// \c CloseFile() is called, regardless of how many calls are made to \c PutXMP().
462
+ ///
463
+ /// Typically, the XMP is not parsed and legacy reconciliation is not performed until \c GetXMP()
464
+ /// is called, but this is not guaranteed. Specific file handlers might do earlier parsing of
465
+ /// the XMP. Delayed parsing and early disk file close for read-only access are optimizations
466
+ /// to help clients implementing file browsers, so that they can access the file briefly
467
+ /// and possibly display a thumbnail, then postpone more expensive XMP processing until later.
468
+ ///
469
+ /// @param filePath The path for the file, appropriate for the local operating system. Passed as
470
+ /// a nul-terminated UTF-8 string.
471
+ ///
472
+ /// @param format The format of the file. If the format is unknown (\c #kXMP_UnknownFile) the
473
+ /// format is determined from the file content. The first handler to check is guessed from the
474
+ /// file's extension. Passing a specific format value is generally just a hint about what file
475
+ /// handler to try first (instead of the one based on the extension). If
476
+ /// \c #kXMPFiles_OpenStrictly is set, then any format other than \c #kXMP_UnknownFile requires
477
+ /// that the file actually be that format; otherwise an exception is thrown.
478
+ ///
479
+ /// @param openFlags A set of option flags that describe the desired access. By default (zero)
480
+ /// the file is opened for read-only access and the format handler decides on the level of
481
+ /// reconciliation that will be performed. A logical OR of these bit-flag constants:
482
+ ///
483
+ /// \li \c #kXMPFiles_OpenForRead - Open for read-only access.
484
+ /// \li \c #kXMPFiles_OpenForUpdate - Open for reading and writing.
485
+ /// \li \c #kXMPFiles_OpenOnlyXMP - Only the XMP is wanted, no reconciliation.
486
+ /// \li \c #kXMPFiles_OpenStrictly - Be strict about locating XMP and reconciling with other
487
+ /// forms. By default, a best effort is made to locate the correct XMP and to reconcile XMP
488
+ /// with other forms (if reconciliation is done). This option forces stricter rules, resulting
489
+ /// in exceptions for errors. The definition of strictness is specific to each handler, there
490
+ /// might be no difference.
491
+ /// \li \c #kXMPFiles_OpenUseSmartHandler - Require the use of a smart handler.
492
+ /// \li \c #kXMPFiles_OpenUsePacketScanning - Force packet scanning, do not use a smart handler.
493
+ /// \li \c #kXMPFiles_OptimizeFileLayout - When updating a file, spend the effort necessary
494
+ /// to optimize file layout.
495
+ ///
496
+ /// @return True if the file is succesfully opened and attached to a file handler. False for
497
+ /// anticipated problems, such as passing \c #kXMPFiles_OpenUseSmartHandler but not having an
498
+ /// appropriate smart handler. Throws an exception for serious problems.
499
+
500
+ bool OpenFile ( XMP_StringPtr filePath,
501
+ XMP_FileFormat format = kXMP_UnknownFile,
502
+ XMP_OptionBits openFlags = 0 );
503
+
504
+ // ---------------------------------------------------------------------------------------------
505
+ /// @brief \c OpenFile() opens a file for metadata access, using a string object
506
+ ///
507
+ /// Overloads the basic form of the function, allowing you to pass a string object for the file
508
+ /// path. It is otherwise identical; see details in the canonical form.
509
+
510
+ bool OpenFile ( const tStringObj & filePath,
511
+ XMP_FileFormat format = kXMP_UnknownFile,
512
+ XMP_OptionBits openFlags = 0 );
513
+
514
+ #if XMP_StaticBuild // ! Client XMP_IO objects can only be used in static builds.
515
+ // ---------------------------------------------------------------------------------------------
516
+ /// @brief \c OpenFile() opens a client-provided XMP_IO object for metadata access.
517
+ ///
518
+ /// Alternative to the basic form of the function, allowing you to pass an XMP_IO object for
519
+ /// client-managed I/O.
520
+ ///
521
+
522
+ bool OpenFile ( XMP_IO * clientIO,
523
+ XMP_FileFormat format = kXMP_UnknownFile,
524
+ XMP_OptionBits openFlags = 0 );
525
+ #endif
526
+
527
+ // ---------------------------------------------------------------------------------------------
528
+ /// @brief CloseFile() explicitly closes an opened file.
529
+ ///
530
+ /// Performs any necessary output to the file and closes it. Files that are opened for update
531
+ /// are written to only when closing.
532
+ ///
533
+ /// If the file is opened for read-only access (passing \c #kXMPFiles_OpenForRead), the disk
534
+ /// file is closed immediately after reading the data from it; the \c XMPFiles object, however,
535
+ /// remains in the open state. You must call \c CloseFile() when finished using it. Other
536
+ /// methods, such as \c GetXMP(), can only be used between the \c OpenFile() and \c CloseFile()
537
+ /// calls. The \c XMPFiles destructor does not call \c CloseFile(); if you call it without closing,
538
+ /// any pending updates are lost.
539
+ ///
540
+ /// If the file is opened for update (passing \c #kXMPFiles_OpenForUpdate), the disk file remains
541
+ /// open until \c CloseFile() is called. The disk file is only updated once, when \c CloseFile()
542
+ /// is called, regardless of how many calls are made to \c PutXMP(). When in-place update is not possible
543
+ /// we might write into a temporary file and then swap for corruption/crash safety. /* Documenatation update for CTECHXMP-4170278*/
544
+ ///
545
+ /// @param closeFlags Option flags for optional closing actions. This bit-flag constant is
546
+ /// defined:
547
+ ///
548
+ /// \li \c #kXMPFiles_UpdateSafely - Write into a temporary file then swap for crash safety.
549
+
550
+ void CloseFile ( XMP_OptionBits closeFlags = 0 );
551
+
552
+ // ---------------------------------------------------------------------------------------------
553
+ /// @brief \c GetFileInfo() retrieves basic information about an opened file.
554
+ ///
555
+ /// @param filePath [out] A buffer in which to return the path passed to \c OpenFile(). Can be
556
+ /// null if value is not wanted.
557
+ ///
558
+ /// @param openFlags [out] A buffer in which to return the option flags passed to
559
+ /// \c OpenFile(). Can be null if value is not wanted.
560
+ ///
561
+ /// @param format [out] A buffer in which to return the file format. Can be null if value is not
562
+ /// wanted.
563
+ /// @param handlerFlags [out] A buffer in which to return the handler's capability flags. Can
564
+ /// be null if value is not wanted.
565
+ ///
566
+ /// @return True if the file object is in the open state; that is, \c OpenFile() has been called
567
+ /// but \c CloseFile() has not. False otherwise. Even if the file object is open, the actual
568
+ /// disk file might be closed in the host file-system sense; see \c OpenFile().
569
+
570
+ bool GetFileInfo ( tStringObj * filePath = 0,
571
+ XMP_OptionBits * openFlags = 0,
572
+ XMP_FileFormat * format = 0,
573
+ XMP_OptionBits * handlerFlags = 0 );
574
+
575
+ // ---------------------------------------------------------------------------------------------
576
+ /// @brief \c SetAbortProc() registers a callback function used to check for a user-signaled abort.
577
+ ///
578
+ /// The specified procedure is called periodically to allow a user to cancel time-consuming
579
+ /// operations. The callback function should return true to signal an abort, which results in an
580
+ /// exception being thrown.
581
+ ///
582
+ /// @param abortProc The callback function.
583
+ ///
584
+ /// @param abortArg A pointer to caller-defined data to pass to the callback function.
585
+
586
+ void SetAbortProc ( XMP_AbortProc abortProc,
587
+ void * abortArg );
588
+
589
+ /// @}
590
+
591
+ // =============================================================================================
592
+ /// \name Accessing metadata
593
+ /// @{
594
+ ///
595
+ /// These functions allow you to retrieve XMP metadata from open files, so that you can use the
596
+ /// \c TXMPMeta API to manipulate it. The \c PutXMP() functions update the XMP packet in memory.
597
+ /// Changed XMP is not actually written out to the file until the file is closed.
598
+
599
+ // ---------------------------------------------------------------------------------------------
600
+ /// @brief \c GetXMP() retrieves the XMP metadata from an open file.
601
+ ///
602
+ /// The function reports whether XMP is present in the file; you can choose to retrieve any or
603
+ /// all of the parsed XMP, the raw XMP packet,or information about the raw XMP packet. The
604
+ /// options provided when the file was opened determine if reconciliation is done with other
605
+ /// forms of metadata.
606
+ ///
607
+ /// @param xmpObj [out] An XMP object in which to return the parsed XMP metadata. Can be null.
608
+ ///
609
+ /// @param xmpPacket [out] An string object in which to return the raw XMP packet as stored in
610
+ /// the file. Can be null. The encoding of the packet is given in the \c packetInfo. Returns an
611
+ /// empty string if the low level file handler does not provide the raw packet.
612
+ ///
613
+ /// @param packetInfo [out] An string object in which to return the location and form of the raw
614
+ /// XMP in the file. \c #XMP_PacketInfo::charForm and \c #XMP_PacketInfo::writeable reflect the
615
+ /// raw XMP in the file. The parsed XMP property values are always UTF-8. The writeable flag is
616
+ /// taken from the packet trailer; it applies only to "format ignorant" writing. The
617
+ /// \c #XMP_PacketInfo structure always reflects the state of the XMP in the file. The offset,
618
+ /// length, and character form do not change as a result of calling \c PutXMP() unless the file
619
+ /// is also written. Some file handlers might not return location or contents of the raw packet
620
+ /// string. To determine whether one does, check the \c #kXMPFiles_ReturnsRawPacket bit returned
621
+ /// by \c GetFormatInfo(). If the low-level file handler does not provide the raw packet
622
+ /// location, \c #XMP_PacketInfo::offset and \c #XMP_PacketInfo::length are both 0,
623
+ /// \c #XMP_PacketInfo::charForm is UTF-8, and \c #XMP_PacketInfo::writeable is false.
624
+ ///
625
+ /// @return True if the file has XMP, false otherwise.
626
+
627
+ bool GetXMP ( SXMPMeta * xmpObj = 0,
628
+ tStringObj * xmpPacket = 0,
629
+ XMP_PacketInfo * packetInfo = 0 );
630
+
631
+ // ---------------------------------------------------------------------------------------------
632
+ /// @brief \c PutXMP() updates the XMP metadata in this object without writing out the file.
633
+ ///
634
+ /// This function supplies new XMP for the file. However, the disk file is not written until the
635
+ /// object is closed with \c CloseFile(). The options provided when the file was opened
636
+ /// determine if reconciliation is done with other forms of metadata.
637
+ ///
638
+ /// @param xmpObj The new metadata as an XMP object.
639
+
640
+ void PutXMP ( const SXMPMeta & xmpObj );
641
+
642
+ // ---------------------------------------------------------------------------------------------
643
+ /// @brief \c PutXMP() updates the XMP metadata in this object without writing out the file,
644
+ /// using a string object for input.
645
+ ///
646
+ /// Overloads the basic form of the function, allowing you to pass the metadata as a string object
647
+ /// instead of an XMP object. It is otherwise identical; see details in the canonical form.
648
+ ///
649
+ /// @param xmpPacket The new metadata as a string object containing a complete XMP packet.
650
+
651
+ void PutXMP ( const tStringObj & xmpPacket );
652
+
653
+ // ---------------------------------------------------------------------------------------------
654
+ /// @brief \c PutXMP() updates the XMP metadata in this object without writing out the file,
655
+ /// using a string object and optional length.
656
+ ///
657
+ /// Overloads the basic form of the function, allowing you to pass the metadata as a string object
658
+ /// instead of an XMP object. It is otherwise identical; see details in the canonical form.
659
+ ///
660
+ /// @param xmpPacket The new metadata as a <tt>const char *</tt> string containing an XMP packet.
661
+ ///
662
+ /// @param xmpLength Optional. The number of bytes in the string. If not supplied, the string is
663
+ /// assumed to be nul-terminated.
664
+
665
+ void PutXMP ( XMP_StringPtr xmpPacket,
666
+ XMP_StringLen xmpLength = kXMP_UseNullTermination );
667
+
668
+ // ---------------------------------------------------------------------------------------------
669
+ /// @brief \c CanPutXMP() reports whether this file can be updated with a specific XMP packet.
670
+ ///
671
+ /// Use to determine if the file can probably be updated with a given set of XMP metadata. This
672
+ /// depends on the size of the packet, the options with which the file was opened, and the
673
+ /// capabilities of the handler for the file format. The function obtains the length of the
674
+ /// serialized packet for the provided XMP, but does not keep it or modify it, and does not
675
+ /// cause the file to be written when closed. This is implemented roughly as follows:
676
+ ///
677
+ /// <pre>
678
+ /// bool CanPutXMP ( XMP_StringPtr xmpPacket )
679
+ /// {
680
+ /// XMP_FileFormat format;
681
+ /// this->GetFileInfo ( 0, &format, 0 );
682
+ ///
683
+ /// XMP_OptionBits formatFlags;
684
+ /// GetFormatInfo ( format, &formatFlags );
685
+ ///
686
+ /// if ( (formatFlags & kXMPFiles_CanInjectXMP) && (formatFlags & kXMPFiles_CanExpand) ) return true;
687
+ ///
688
+ /// XMP_PacketInfo packetInfo;
689
+ /// bool hasXMP = this->GetXMP ( 0, 0, &packetInfo );
690
+ ///
691
+ /// if ( ! hasXMP ) {
692
+ /// if ( formatFlags & kXMPFiles_CanInjectXMP ) return true;
693
+ /// } else {
694
+ /// if ( (formatFlags & kXMPFiles_CanExpand) ||
695
+ /// (packetInfo.length >= strlen(xmpPacket)) ) return true;
696
+ /// }
697
+ /// return false;
698
+ /// }
699
+ /// </pre>
700
+ ///
701
+ /// @param xmpObj The proposed new metadata as an XMP object.
702
+
703
+ bool CanPutXMP ( const SXMPMeta & xmpObj );
704
+
705
+ // ---------------------------------------------------------------------------------------------
706
+ /// @brief \c CanPutXMP() reports whether this file can be updated with a specific XMP packet,
707
+ /// passed in a string object.
708
+ ///
709
+ /// Overloads the basic form of the function, allowing you to pass the metadata as a string object
710
+ /// instead of an XMP object. It is otherwise identical; see details in the canonical form.
711
+ ///
712
+ /// @param xmpPacket The proposed new metadata as a string object containing an XMP packet.
713
+
714
+ bool CanPutXMP ( const tStringObj & xmpPacket );
715
+
716
+ // ---------------------------------------------------------------------------------------------
717
+ /// @brief \c CanPutXMP() reports whether this file can be updated with a specific XMP packet,
718
+ /// passed in a string object.
719
+ ///
720
+ /// Overloads the basic form of the function, allowing you to pass the metadata as a string object
721
+ /// instead of an XMP object. It is otherwise identical; see details in the canonical form.
722
+ ///
723
+ /// @param xmpPacket The proposed new metadata as a <tt>const char *</tt> string containing an XMP packet.
724
+ ///
725
+ /// @param xmpLength Optional. The number of bytes in the string. If not supplied, the string
726
+ /// is assumed to be nul-terminated.
727
+
728
+ bool CanPutXMP ( XMP_StringPtr xmpPacket,
729
+ XMP_StringLen xmpLength = kXMP_UseNullTermination );
730
+
731
+ /// @}
732
+
733
+ // =============================================================================================
734
+ /// \name Progress notifications
735
+ /// @{
736
+ ///
737
+ /// These functions allow track the progress of file operations. Initially only file updates are
738
+ /// tracked, these all occur within calls to SXMPFiles::CloseFile. There are no plans to track
739
+ /// other operations at this time. Tracking support must be added to specific file handlers,
740
+ /// there are no guarantees about which handlers will have support. To simplify the logic only
741
+ /// file writes will be estimated and measured.
742
+
743
+ // ---------------------------------------------------------------------------------------------
744
+ /// @brief \c SetDefaultProgressCallback() sets a global default for progress tracking. This is
745
+ /// used as a default for XMPFiles (library) objects created after the default is set. This does
746
+ /// not affect the callback for new SXMPFiles (client) objects with an existing XMPFiles object.
747
+ ///
748
+ /// @param proc The client's callback function. Can be zero to disable notifications.
749
+ ///
750
+ /// @param context A pointer used to carry client-private context.
751
+ ///
752
+ /// @param interval The desired number of seconds between notifications. Ideally the first
753
+ /// notification is sent after this interval, then at each following multiple of this interval.
754
+ ///
755
+ /// @param sendStartStop A Boolean value indicating if initial and final notifications are
756
+ /// wanted in addition to those at the reporting intervals.
757
+
758
+ static void SetDefaultProgressCallback ( XMP_ProgressReportProc proc, void * context = 0,
759
+ float interval = 1.0, bool sendStartStop = false );
760
+
761
+ // ---------------------------------------------------------------------------------------------
762
+ /// @brief \c SetProgressCallback() sets the progress notification callback for the associated
763
+ /// XMPFiles (library) object.
764
+ ///
765
+ /// @param proc The client's callback function. Can be zero to disable notifications.
766
+ ///
767
+ /// @param context A pointer used to carry client-private context.
768
+ ///
769
+ /// @param interval The desired number of seconds between notifications. Ideally the first
770
+ /// notification is sent after this interval, then at each following multiple of this interval.
771
+ ///
772
+ /// @param sendStartStop A Boolean value indicating if initial and final notifications are
773
+ /// wanted in addition to those at the reporting intervals.
774
+
775
+ void SetProgressCallback ( XMP_ProgressReportProc proc, void * context = 0,
776
+ float interval = 1.0, bool sendStartStop = false );
777
+
778
+ /// @}
779
+
780
+ // =============================================================================================
781
+ // Error notifications
782
+ // ===================
783
+
784
+ // ---------------------------------------------------------------------------------------------
785
+ /// \name Error notifications
786
+ /// @{
787
+ ///
788
+ /// From the beginning through version 5.5, XMP Toolkit errors result in throwing an \c XMP_Error
789
+ /// exception. For the most part exceptions were thrown early and thus API calls aborted as soon
790
+ /// as an error was detected. Starting in version 5.5, support has been added for notifications
791
+ /// of errors arising in calls to \c TXMPFiles functions.
792
+ ///
793
+ /// A client can register an error notification callback function for a \c TXMPFile object. This
794
+ /// can be done as a global default or individually to each object. The global default applies
795
+ /// to all objects created after it is registered. Within the object there is no difference
796
+ /// between the global default or explicitly registered callback. The callback function returns
797
+ /// a \c bool value indicating if recovery should be attempted (true) or an exception thrown
798
+ /// (false). If no callback is registered, a best effort at recovery and continuation will be
799
+ /// made with an exception thrown if recovery is not possible.
800
+ ///
801
+ /// The number of notifications delivered for a given TXMPFiles object can be limited. This is
802
+ /// intended to reduce chatter from multiple or cascading errors. The limit is set when the
803
+ /// callback function is registered. This limits the number of notifications of the highest
804
+ /// severity delivered or less. If a higher severity error occurs, the counting starts again.
805
+ /// The limit and counting can be reset at any time, see \c ResetErrorCallbackLimit.
806
+
807
+ // --------------------------------------------------------------------------------------------
808
+ /// @brief SetDefaultErrorCallback() registers a global default error notification callback.
809
+ ///
810
+ /// @param proc The client's callback function.
811
+ ///
812
+ /// @param context Client-provided context for the callback.
813
+ ///
814
+ /// @param limit A limit on the number of notifications to be delivered.
815
+
816
+ static void SetDefaultErrorCallback ( XMPFiles_ErrorCallbackProc proc, void* context = 0, XMP_Uns32 limit = 1 );
817
+
818
+ // --------------------------------------------------------------------------------------------
819
+ /// @brief SetErrorCallback() registers an error notification callback.
820
+ ///
821
+ /// @param proc The client's callback function.
822
+ ///
823
+ /// @param context Client-provided context for the callback.
824
+ ///
825
+ /// @param limit A limit on the number of notifications to be delivered.
826
+
827
+ void SetErrorCallback ( XMPFiles_ErrorCallbackProc proc, void* context = 0, XMP_Uns32 limit = 1 );
828
+
829
+ // --------------------------------------------------------------------------------------------
830
+ /// @brief ResetErrorCallbackLimit() resets the error notification limit and counting. It has no
831
+ /// effect if an error notification callback function is not registered.
832
+ ///
833
+ /// @param limit A limit on the number of notifications to be delivered.
834
+
835
+ void ResetErrorCallbackLimit ( XMP_Uns32 limit = 1 );
836
+
837
+ /// @}
838
+
839
+ // =============================================================================================
840
+
841
+ private:
842
+
843
+ XMPFilesRef xmpFilesRef;
844
+
845
+ // These are used as callbacks from the library code to the client when returning values that
846
+ // involve heap allocations. This ensures the allocations occur within the client.
847
+ static void SetClientString ( void * clientPtr, XMP_StringPtr valuePtr, XMP_StringLen valueLen );
848
+ static void SetClientStringVector ( void * clientPtr, XMP_StringPtr* arrayPtr, XMP_Uns32 stringCount );
849
+ }; // class TXMPFiles
850
+
851
+ // =================================================================================================
852
+
853
+ #endif // __TXMPFiles_hpp__