XmpUtils
XmpUtils Public class
Description
Utility methods for XMP. I included only those that are different from the Java default conversion utilities.
@since 21.02.2006
Diagram
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph iTextSharp.xmp
iTextSharp.xmp.XmpUtils[[XmpUtils]]
end
Members
Methods
Public Static methods
| Returns | Name |
|---|---|
void | AppendProperties(...)Alias without the new option ... |
string | CatenateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string separator, string quotes, bool allowCommas)Create a single edit string from an array of strings. |
string | ConvertFromBoolean(bool value)Convert from boolean to string. |
string | ConvertFromDate(IXmpDateTime value)Convert from ... |
string | ConvertFromDouble(double value)Convert from long to string. |
string | ConvertFromInteger(int value)Convert from int to string. |
string | ConvertFromLong(long value)Convert from long to string. |
bool | ConvertToBoolean(string value) |
IXmpDateTime | ConvertToDate(string rawValue)Converts a string value to an ... |
double | ConvertToDouble(string rawValue)Converts a string value to a ... |
int | ConvertToInteger(string rawValue)Converts a string value to an ... |
long | ConvertToLong(string rawValue)Converts a string value to a ... |
byte``[] | DecodeBase64(string base64String)Decode from Base64 encoded string to raw data. |
string | EncodeBase64(byte``[] buffer)Convert from a byte array to a base64 encoded string. |
void | RemoveProperties(IXmpMeta xmp, string schemaNs, string propName, bool doAllProperties, bool includeAliases) |
void | SeparateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string catedStr, PropertyOptions arrayOptions, bool preserveCommas)Separate a single edit string into an array of strings. |
Details
Summary
Utility methods for XMP. I included only those that are different from the Java default conversion utilities.
@since 21.02.2006
Methods
CatenateArrayItems
Source codepublic static string CatenateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string separator, string quotes, bool allowCommas)
Arguments
| Type | Name | Description |
|---|---|---|
IXmpMeta | xmp | The XMP object containing the array to be catenated. |
string | schemaNs | The schema namespace URI for the array. Must not be null or the empty string. |
string | arrayName | 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. |
string | separator | The string to be used to separate the items in the catenated string. Defaults to "; ", ASCII semicolon and space (U+003B, U+0020). |
string | quotes | The characters to be used as quotes around array items that contain a separator. Defaults to '"' |
bool | allowCommas | Option flag to control the catenation. |
Summary
Create a single edit string from an array of strings.
Returns
Returns the string containing the catenated array items.
Exceptions
| Name | Description |
|---|---|
| XmpException | Forwards the Exceptions from the metadata processing |
SeparateArrayItems
Source codepublic static void SeparateArrayItems(IXmpMeta xmp, string schemaNs, string arrayName, string catedStr, PropertyOptions arrayOptions, bool preserveCommas)
Arguments
| Type | Name | Description |
|---|---|---|
IXmpMeta | xmp | The XMP object containing the array to be updated. |
string | schemaNs | The schema namespace URI for the array. Must not be null or the empty string. |
string | arrayName | 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. |
string | catedStr | The string to be separated into the array items. |
PropertyOptions | arrayOptions | Option flags to control the separation. |
bool | preserveCommas | Flag if commas shall be preserved |
Summary
Separate a single edit string into an array of strings.
Exceptions
| Name | Description |
|---|---|
| XmpException | Forwards the Exceptions from the metadata processing |
RemoveProperties
Source codepublic static void RemoveProperties(IXmpMeta xmp, string schemaNs, string propName, bool doAllProperties, bool includeAliases)
Arguments
| Type | Name | Description |
|---|---|---|
IXmpMeta | xmp | |
string | schemaNs | |
string | propName | |
bool | doAllProperties | |
bool | includeAliases |
AppendProperties [1/2]
Source codepublic static void AppendProperties(IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues)
Arguments
| Type | Name | Description |
|---|---|---|
IXmpMeta | source | The source XMP object. |
IXmpMeta | dest | The destination XMP object. |
bool | doAllProperties | Do internal properties in addition to external properties. |
bool | replaceOldValues | Replace the values of existing properties. |
Summary
Alias without the new option
deleteEmptyValues
Exceptions
| Name | Description |
|---|---|
| XmpException | Forwards the Exceptions from the metadata processing |
AppendProperties [2/2]
Source codepublic static void AppendProperties(IXmpMeta source, IXmpMeta dest, bool doAllProperties, bool replaceOldValues, bool deleteEmptyValues)
Arguments
| Type | Name | Description |
|---|---|---|
IXmpMeta | source | |
IXmpMeta | dest | |
bool | doAllProperties | |
bool | replaceOldValues | |
bool | deleteEmptyValues |
ConvertToBoolean
Source codepublic static bool ConvertToBoolean(string value)
Arguments
| Type | Name | Description |
|---|---|---|
string | value |
ConvertFromBoolean
Source codepublic static string ConvertFromBoolean(bool value)
Arguments
| Type | Name | Description |
|---|---|---|
bool | value | a boolean value |
Summary
Convert from boolean to string.
Returns
The XMP string representation of the boolean. The values used are given by the constnts and .
ConvertToInteger
Source codepublic static int ConvertToInteger(string rawValue)
Arguments
| Type | Name | Description |
|---|---|---|
string | rawValue | the string value |
Summary
Converts a string value to an
int
Returns
Returns an int.
Exceptions
| Name | Description |
|---|---|
| XmpException | If the ... |
ConvertFromInteger
Source codepublic static string ConvertFromInteger(int value)
Arguments
| Type | Name | Description |
|---|---|---|
int | value | an int value |
Summary
Convert from int to string.
Returns
The string representation of the int.
ConvertToLong
Source codepublic static long ConvertToLong(string rawValue)
Arguments
| Type | Name | Description |
|---|---|---|
string | rawValue | the string value |
Summary
Converts a string value to a
long
Returns
Returns a long.
Exceptions
| Name | Description |
|---|---|
| XmpException | If the ... |
ConvertFromLong
Source codepublic static string ConvertFromLong(long value)
Arguments
| Type | Name | Description |
|---|---|---|
long | value | a long value |
Summary
Convert from long to string.
Returns
The string representation of the long.
ConvertToDouble
Source codepublic static double ConvertToDouble(string rawValue)
Arguments
| Type | Name | Description |
|---|---|---|
string | rawValue | the string value |
Summary
Converts a string value to a
double
Returns
Returns a double.
Exceptions
| Name | Description |
|---|---|
| XmpException | If the ... |
ConvertFromDouble
Source codepublic static string ConvertFromDouble(double value)
Arguments
| Type | Name | Description |
|---|---|---|
double | value | a long value |
Summary
Convert from long to string.
Returns
The string representation of the long.
ConvertToDate
Source codepublic static IXmpDateTime ConvertToDate(string rawValue)
Arguments
| Type | Name | Description |
|---|---|---|
string | rawValue | the string value |
Summary
Converts a string value to an
XMPDateTime
Returns
Returns an
XMPDateTime
Exceptions
| Name | Description |
|---|---|
| XmpException | If the ... |
ConvertFromDate
Source codepublic static string ConvertFromDate(IXmpDateTime value)
Arguments
| Type | Name | Description |
|---|---|---|
IXmpDateTime | value | an ... |
Summary
Convert from
XMPDateTime
Returns
The string representation of the long.
EncodeBase64
Source codepublic static string EncodeBase64(byte[] buffer)
Arguments
| Type | Name | Description |
|---|---|---|
byte``[] | buffer | the byte array to be converted |
Summary
Convert from a byte array to a base64 encoded string.
Returns
Returns the base64 string.
DecodeBase64
Source codepublic static byte DecodeBase64(string base64String)
Arguments
| Type | Name | Description |
|---|---|---|
string | base64String | a base64 encoded string |
Summary
Decode from Base64 encoded string to raw data.
Returns
Returns a byte array containg the decoded string.
Exceptions
| Name | Description |
|---|---|
| XmpException | Thrown if the given string is not property base64 encoded |
Generated with ModularDoc