Method | Description | |
---|---|---|
AppendProperties ( IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues ) : void |
Alias without the new option
|
|
AppendProperties ( IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues, bool deleteEmptyValues ) : void |
Append properties from one XMP object to another. XMPUtils#appendProperties was created to support the File Info dialog's Append button, and has been been generalized somewhat from those specific needs. It appends information from one XMP object (source) to another (dest). The default operation is to append only external properties that do not already exist in the destination. The flag
The detailed behavior is defined by the following pseudo-code: appendProperties ( sourceXMP, destXMP, doAllProperties, replaceOldValues, deleteEmptyValues ): for all source schema (top level namespaces): for all top level properties in sourceSchema: if doAllProperties or prop is external: appendSubtree ( sourceNode, destSchema, replaceOldValues, deleteEmptyValues ) appendSubtree ( sourceNode, destParent, replaceOldValues, deleteEmptyValues ): if deleteEmptyValues and source value is empty: delete the corresponding child from destParent else if sourceNode not in destParent (by name): copy sourceNode's subtree to destParent else if replaceOld: delete subtree from destParent copy sourceNode's subtree to destParent else: // Already exists in dest and not replacing, merge structs and arrays if sourceNode and destNode forms differ: return, leave the destNode alone else if form is a struct: for each field in sourceNode: AppendSubtree ( sourceNode.field, destNode, replaceOldValues ) else if form is an alt-text array: copy new items by "xml:lang" value into the destination else if form is an array: copy new items by value into the destination, ignoring order and duplicates Note: appendProperties can be expensive if replaceOldValues is not passed and the XMP contains large arrays. The array item checking described above is n-squared. Each source item is checked to see if it already exists in the destination, without regard to order or duplicates. Simple items are compared by value and "xml:lang" qualifier, other qualifiers are ignored. Structs are recursively compared by field names, without regard to field order. Arrays are compared by recursively comparing all items.
|
|
CatenateArrayItems ( IXmpMeta xmp, string schemaNs, string arrayName, string separator, string quotes, bool allowCommas ) : string |
Create a single edit string from an array of strings.
|
|
ConvertFromBoolean ( bool value ) : string |
Convert from boolean to string.
|
|
ConvertFromDate ( IXmpDateTime value ) : string |
Convert from
|
|
ConvertFromDouble ( double value ) : string |
Convert from long to string.
|
|
ConvertFromInteger ( int value ) : string |
Convert from int to string.
|
|
ConvertFromLong ( long value ) : string |
Convert from long to string.
|
|
ConvertToBoolean ( string value ) : bool |
Convert from string to Boolean.
|
|
ConvertToDate ( string rawValue ) : IXmpDateTime |
Converts a string value to an
|
|
ConvertToDouble ( string rawValue ) : double |
Converts a string value to a
|
|
ConvertToInteger ( string rawValue ) : int |
Converts a string value to an
|
|
ConvertToLong ( string rawValue ) : long |
Converts a string value to a
|
|
DecodeBase64 ( string base64String ) : byte[] |
Decode from Base64 encoded string to raw data.
|
|
EncodeBase64 ( byte buffer ) : string |
Convert from a byte array to a base64 encoded string.
|
|
RemoveProperties ( IXmpMeta xmp, string schemaNs, string propName, bool doAllProperties, bool includeAliases ) : void |
Remove multiple properties from an XMP object. RemoveProperties was created to support the File Info dialog's Delete button, and has been been generalized somewhat from those specific needs. It operates in one of three main modes depending on the schemaNs and propName parameters:
schemaNs and non-empty propName .
|
|
SeparateArrayItems ( IXmpMeta xmp, string schemaNs, string arrayName, string catedStr, |
Separate a single edit string into an array of strings.
|
Method | Description | |
---|---|---|
GetBytes ( string str ) : byte[] | ||
GetString ( byte bytes ) : string | ||
XmpUtils ( ) : System |
Private constructor
|
public static AppendProperties ( IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues ) : void | ||
source | IXmpMeta | The source XMP object. |
dest | IXmpMeta | The destination XMP object. |
doAllProperties | bool | Do internal properties in addition to external properties. |
replaceOldValues | bool | Replace the values of existing properties. |
return | void |
public static AppendProperties ( IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues, bool deleteEmptyValues ) : void | ||
source | IXmpMeta | The source XMP object. |
dest | IXmpMeta | The destination XMP object. |
doAllProperties | bool | Do internal properties in addition to external properties. |
replaceOldValues | bool | Replace the values of existing properties. |
deleteEmptyValues | bool | Delete destination values if source property is empty. |
return | void |
public static CatenateArrayItems ( IXmpMeta xmp, string schemaNs, string arrayName, string separator, string quotes, bool allowCommas ) : string | ||
xmp | IXmpMeta | /// The XMP object containing the array to be catenated. |
schemaNs | string | /// The schema namespace URI for the array. Must not be null or /// the empty string. |
arrayName | string | /// The name of the array. May be a general path expression, must /// not be null or the empty string. Each item in the array must /// be a simple string value. |
separator | string | /// The string to be used to separate the items in the catenated /// string. Defaults to "; ", ASCII semicolon and space /// (U+003B, U+0020). |
quotes | string | /// The characters to be used as quotes around array items that /// contain a separator. Defaults to '"' |
allowCommas | bool | /// Option flag to control the catenation. |
return | string |
public static ConvertFromBoolean ( bool value ) : string | ||
value | bool | /// a boolean value |
return | string |
public static ConvertFromDate ( IXmpDateTime value ) : string | ||
value | IXmpDateTime |
/// an XMPDateTime |
return | string |
public static ConvertFromDouble ( double value ) : string | ||
value | double | /// a long value |
return | string |
public static ConvertFromInteger ( int value ) : string | ||
value | int | /// an int value |
return | string |
public static ConvertFromLong ( long value ) : string | ||
value | long | /// a long value |
return | string |
public static ConvertToBoolean ( string value ) : bool | ||
value | string | /// The string representation of the Boolean. |
return | bool |
public static ConvertToDate ( string rawValue ) : IXmpDateTime | ||
rawValue | string | /// the string value |
return | IXmpDateTime |
public static ConvertToDouble ( string rawValue ) : double | ||
rawValue | string | /// the string value |
return | double |
public static ConvertToInteger ( string rawValue ) : int | ||
rawValue | string | /// the string value |
return | int |
public static ConvertToLong ( string rawValue ) : long | ||
rawValue | string | /// the string value |
return | long |
public static DecodeBase64 ( string base64String ) : byte[] | ||
base64String | string | /// a base64 encoded string |
return | byte[] |
public static EncodeBase64 ( byte buffer ) : string | ||
buffer | byte | /// the byte array to be converted |
return | string |
public static RemoveProperties ( IXmpMeta xmp, string schemaNs, string propName, bool doAllProperties, bool includeAliases ) : void | ||
xmp | IXmpMeta | /// The XMP object containing the properties to be removed. /// |
schemaNs | string | /// Optional schema namespace URI for the properties to be /// removed. /// |
propName | string | /// Optional path expression for the property to be removed. /// |
doAllProperties | bool | Option flag to control the deletion: do internal properties in /// addition to external properties. /// |
includeAliases | bool | Option flag to control the deletion: /// Include aliases in the "named schema" case above. /// Note: Currently not supported. |
return | void |
public static SeparateArrayItems ( IXmpMeta xmp, string schemaNs, string arrayName, string catedStr, |
||
xmp | IXmpMeta | /// The XMP object containing the array to be updated. |
schemaNs | string | /// The schema namespace URI for the array. Must not be null or /// the empty string. |
arrayName | string | /// The name of the array. May be a general path expression, must /// not be null or the empty string. Each item in the array must /// be a simple string value. |
catedStr | string | /// The string to be separated into the array items. |
arrayOptions | Option flags to control the separation. | |
preserveCommas | bool | Flag if commas shall be preserved |
return | void |