convert_to_string
The value of this metadata item, converted into a string form using a pre-defined set of formats.
This method applies the same transformations during the conversion to string as the metadata_map method.
- Boolean values are represented as either 'true' or 'false'.
- Date-time values are represented as an integer number of epoch seconds (the number of seconds since the beginning of January 1st, 1970).
- Binary values are represented by treating them as strings - interpreting each individual byte as if it were a character in the computer's single-byte code page.
-
MIPLabel values are printed as
[LabelID="<label.labelId>", Enabled=<label.enabled>, SiteId="<label.siteId>", ActionId="<label.actionId>", Method="<label.method>", SetDate=<label.setDate>, Name="<label.name>", ContentBits=<label.contentBits>]
.Optional MIPLabel member data are presented in the converted string only if they are non-null. For example, if the pointer
label.setDate
is empty, the entire segmentSetDate=value
is absent from the output.Non-string members are presented in the same format as they would be as standalone values - the boolean
Enabled
is presented as 'true' or 'false', the date-timeSetDate
is presented in epoch seconds.
Syntax
std::string convert_to_string() const;
Discussion
The MetadataElement
class also provides a conversion operator to std::string
. This allows you to use MetadataElement
instances when std::string
values are expected, without needing to call convert_to_string()
. The resulting string is identical to the one produced by calling convert_to_string()
.