exempi.xmp

Members

Aliases

XmpPtr
alias XmpPtr = void*

pointer to XMP packet. Opaque.

Enums

XMP_SERIAL_OMITPACKETWRAPPER
enum XMP_SERIAL_OMITPACKETWRAPPER

set option bits

XMP_TZ_WEST
enum XMP_TZ_WEST

Values used for tzSign field.

XmpCloseFileOptions
enum XmpCloseFileOptions

Option bits for xmp_files_close()

Functions

xmp_append_array_item
bool xmp_append_array_item(XmpPtr xmp, const char* schema, const char* name, uint arrayOptions, const char* value, uint optionBits)

Append a value to the XMP Property array in the XMP Packet provided @param xmp the XMP packet @param schema the schema of the property @param name the name of the property @param arrayOptions option bits of the parent array @param value null-terminated string @param optionBits option bits of the value itself.

xmp_copy
XmpPtr xmp_copy(XmpPtr xmp)

Create a new XMP packet from the one passed. @param xmp the instance to copy. Can be NULL. @return the packet pointer. NULL is failer (or NULL is passed).

xmp_datetime_compare
int xmp_datetime_compare(XmpDateTime* left, XmpDateTime* right)

Compare two XmpDateTime @param left value @param right value @return if left < right, return < 0. If left > right, return > 0. if left == right, return 0.

xmp_delete_property
bool xmp_delete_property(XmpPtr xmp, const char* schema, const char* name)

Delete a property from the XMP Packet provided @param xmp the XMP packet @param schema the schema of the property @param name the name of the property

xmp_files_check_file_format
XmpFileType xmp_files_check_file_format(const char* filePath)

Check the file format of a file. Use the same logic as in xmp_files_open() @param filePath the path to the file @return XMP_FT_UNKNOWN on error or if the file type is unknown

xmp_files_close
bool xmp_files_close(XmpFilePtr xf, XmpCloseFileOptions options)

Close an XMP file. Will flush the changes @param xf the file object @param options the options to close. @return true on succes, false on error xmp_get_error() will give the error code.

xmp_files_free
bool xmp_files_free(XmpFilePtr xf)

Free a XmpFilePtr @param xf the file ptr. Cannot be NULL @return false on error. Calll %xmp_get_error to retrieve the error code.

xmp_files_get_file_info
bool xmp_files_get_file_info(XmpFilePtr xf, XmpStringPtr filePath, XmpOpenFileOptions* options, XmpFileType* file_format, XmpFileFormatOptions* handler_flags)

Get the file info from the open file @param xf the file object @paramout filePath the file path object to store the path in. Pass NULL if not needed. @paramout options the options for open. Pass NULL if not needed. @paramout file_format the detected file format. Pass NULL if not needed. @paramout handler_flags the format options like from %xmp_files_get_format_info. @return false in case of error.

xmp_files_get_format_info
bool xmp_files_get_format_info(XmpFileType format, XmpFileFormatOptions* options)

Get the format info @param format type identifier @param options the options for the file format handler @return false on error

xmp_files_get_new_xmp
XmpPtr xmp_files_get_new_xmp(XmpFilePtr xf)

Get the XMP packet from the file @param xf the %XmpFilePtr to get the XMP packet from @return a newly allocated XmpPtr. Use %xmp_free to release it.

xmp_files_get_xmp
bool xmp_files_get_xmp(XmpFilePtr xf, XmpPtr xmp)

File the XMP packet from the file @param xf the %XmpFilePtr to get the XMP packet from @param xmp the XMP Packet to fill. Must be valid.

xmp_free
bool xmp_free(XmpPtr xmp)

Free the xmp packet @param xmp the xmp packet to free

xmp_get_array_item
bool xmp_get_array_item(XmpPtr xmp, const char* schema, const char* name, int index, XmpStringPtr property, uint* propsBits)

Get an item frpm an array property @param xmp the xmp meta @param schema the schema @param name the property name @param index the index in the array @param property the property value @param propsBits the property bits. Pass NULL is unwanted. @return TRUE if success.

xmp_get_error
int xmp_get_error()

get the error code that last occurred. @todo make this thread-safe. Getting the error code from another thread than the on it occurred in is undefined.

xmp_get_localized_text
bool xmp_get_localized_text(XmpPtr xmp, const char* schema, const char* name, const char* genericLang, const char* specificLang, XmpStringPtr actualLang, XmpStringPtr itemValue, uint* propBits)

Get a localised text from a localisable property. @param xmp the XMP packet @param schema the schema @param name the property name. @param genericLang the generic language you may want as a fall back. Can be NULL or empty. @param specificLang the specific language you want. Can't be NULL or empty. @param actualLang the actual language of the value. Can be NULL if not wanted. @param itemValue the localized value. Can be NULL if not wanted. @param propBits the options flags describing the property. Can be NULL. @return true if found, false otherwise.

xmp_get_property
bool xmp_get_property(XmpPtr xmp, const char* schema, const char* name, XmpStringPtr property, uint* propsBits)

Get an XMP property and it option bits from the XMP packet @param xmp the XMP packet @param schema @param name @param property the allocated XmpStringPtr @param propsBits pointer to the option bits. Pass NULL if not needed @return true if found

xmp_has_property
bool xmp_has_property(XmpPtr xmp, const char* schema, const char* name)

Determines if a property exists in the XMP Packet provided @param xmp the XMP packet @param schema the schema of the property. Can't be NULL or empty. @param name the name of the property. Can't be NULL or empty. @return true is the property exists

xmp_init
bool xmp_init()

Init the library. Must be called before anything else

xmp_iterator_free
bool xmp_iterator_free(XmpIteratorPtr iter)

Free an iterator. @param iter the iterator to free.

xmp_iterator_new
XmpIteratorPtr xmp_iterator_new(XmpPtr xmp, const char* schema, const char* propName, XmpIterOptions options)

Create a new iterator. @param xmp the packet @param schema the property schema @param propName the property name @param options @return an iterator must be freed with % xmp_iterator_free

xmp_iterator_next
bool xmp_iterator_next(XmpIteratorPtr iter, XmpStringPtr schema, XmpStringPtr propName, XmpStringPtr propValue, uint* options)

Iterate to the next value @param iter the iterator @param schema the schema name. Pass NULL if not wanted @param propName the property path. Pass NULL if not wanted @param propValue the value of the property. Pass NULL if not wanted. @param options the options for the property. Pass NULL if not wanted. @return true if still something, false if none

xmp_iterator_skip
bool xmp_iterator_skip(XmpIteratorPtr iter, XmpIterSkipOptions options)
xmp_namespace_prefix
bool xmp_namespace_prefix(const char* ns, XmpStringPtr prefix)

Check is a namespace is registered @param ns the namespace to check. @param prefix The prefix associated if registered. Pass NULL if not interested. @return true if registered. NEW in 2.1

xmp_new
XmpPtr xmp_new(const char* buffer, size_t len)

Create a new XMP packet @param buffer the buffer to load data from. UTF-8 encoded. @param len the buffer length in byte @return the packet pointer. Must be free with xmp_free()

xmp_new_empty
XmpPtr xmp_new_empty()

Create a new empty XMP packet @return the packet pointer. Must be free with xmp_free()

xmp_parse
bool xmp_parse(XmpPtr xmp, const char* buffer, size_t len)

Parse the XML passed through the buffer and load it. @param xmp the XMP packet. @param buffer the buffer. @param len the length of the buffer.

xmp_prefix_namespace_uri
bool xmp_prefix_namespace_uri(const char* prefix, XmpStringPtr ns)

Check if a ns prefix is registered. @param prefix the prefix to check. @param ns the namespace associated if registered. Pass NULL if not interested. @return true if registered. NEW in 2.1

xmp_register_namespace
bool xmp_register_namespace(const char* namespaceURI, const char* suggestedPrefix, XmpStringPtr registeredPrefix)

Register a new namespace to add properties to This is done automatically when reading the metadata block @param namespaceURI the namespace URI to register @param suggestedPrefix the suggested prefix @param registeredPrefix the really registered prefix. Not necessarily %suggestedPrefix. @return true if success, false otherwise.

xmp_serialize
bool xmp_serialize(XmpPtr xmp, XmpStringPtr buffer, uint options, uint padding)

Serialize the XMP Packet to the given buffer @param xmp the XMP Packet @param buffer the buffer to write the XMP to @param options options on how to write the XMP. See XMP_SERIAL_* @param padding number of bytes of padding, useful for modifying embedded XMP in place. @return TRUE if success.

xmp_serialize_and_format
bool xmp_serialize_and_format(XmpPtr xmp, XmpStringPtr buffer, uint options, uint padding, const char* newline, const char* tab, int indent)

Serialize the XMP Packet to the given buffer with formatting @param xmp the XMP Packet @param buffer the buffer to write the XMP to @param options options on how to write the XMP. See XMP_SERIAL_* @param padding number of bytes of padding, useful for modifying embedded XMP in place. @param newline the new line character to use @param tab the indentation character to use @param indent the initial indentation level @return TRUE if success.

xmp_set_localized_text
bool xmp_set_localized_text(XmpPtr xmp, const char* schema, const char* name, const char* genericLang, const char* specificLang, const char* value, uint optionBits)

Set a localised text in a localisable property. @param xmp the XMP packet @param schema the schema @param name the property name. @param genericLang the generic language you may want to set too. Can be NULL or empty. @param specificLang the specific language you want. Can't be NULL or empty. @param value the localized value. Cannot be NULL. @param optionBits the options flags describing the property. @return true if set, false otherwise.

xmp_set_property
bool xmp_set_property(XmpPtr xmp, const char* schema, const char* name, const char* value, uint optionBits)

Set an XMP property in the XMP packet @param xmp the XMP packet @param schema @param name @param value 0 terminated string @param optionBits @return false if failure

xmp_set_property_date
bool xmp_set_property_date(XmpPtr xmp, const char* schema, const char* name, const XmpDateTime* value, uint optionBits)

Set a date XMP property in the XMP packet @param xmp the XMP packet @param schema @param name @param value the date-time struct @param optionBits @return false if failure

xmp_set_property_float
bool xmp_set_property_float(XmpPtr xmp, const char* schema, const char* name, double value, uint optionBits)

Set a float XMP property in the XMP packet @param xmp the XMP packet @param schema @param name @param value the float value @param optionBits @return false if failure

xmp_string_cstr
const(char*) xmp_string_cstr(XmpStringPtr s)

Get the C string from the XmpStringPtr @param s the string object @return the const char * for the XmpStringPtr. It belong to the object.

xmp_string_free
void xmp_string_free(XmpStringPtr s)

Free a XmpStringPtr @param s the string to free

xmp_string_len
size_t xmp_string_len(XmpStringPtr s)

Get the string length from the XmpStringPtr @param s the string object @return the string length. The unerlying implementation has it.

xmp_string_new
XmpStringPtr xmp_string_new()

Instanciate a new string @return the new instance. Must be freed with xmp_string_free()

Structs

XmpPacketInfo
struct XmpPacketInfo

Meta