PropertyConverter Module

Module Contents

class PropertyConverter

Public Functions

PropertyConverter()
~PropertyConverter()
PropertyConverter(PropertyConverter const &other)
PropertyConverter &operator=(PropertyConverter const &other)
bool operator==(PropertyConverter const &other) const
bool operator!=(PropertyConverter const &other) const
void set_timestamp_input_format(string_type const &format)

Set format string for parsing timestamps.

This format string must adhere to the guidelines in the documentation for Boost’s date/time input format. See the following page:

http://www.boost.org/doc/libs/master/doc/html/date_time/date_time_io.html

Parameters
  • [in] format: Format string for timestamp parsing

string_type timestamp_input_format() const

Return the current input format.

Return

Format string for timestamp parsing

void set_timestamp_output_format(string_type const &format)

Set format string for writing timestamps to strings.

This format string must adhere to the guidelines in the documentation for Boost’s date/time input format. See the following page:

http://www.boost.org/doc/libs/master/doc/html/date_time/date_time_io.html

Parameters
  • [in] format: Format string for timestamp output

string_type timestamp_output_format() const

Return the current output format.

Return

Format string for timestamp output

void set_null_value(string_type const &null_value)

Set string that represents null values.

Parameters
  • [in] null_value: String to stand in for nulls

string_type null_value() const

Get string that represents null values.

Return

String representing null

void set_decimal_precision(std::size_t digits)

Set number of digits of precision for writing real numbers.

Parameters
  • [in] digits: Number of digits to use

std::size_t decimal_precision() const

Get number of digits of precision for writing real numbers.

Return

Number of digits in use

string_type property_to_string(PropertyValueT const &property)

Convert a property to a string.

Convert a property to a string according to the current output format.

Return

String representation of timestamp

Parameters
  • [in] property: Value to write

PropertyValueT property_from_string(string_type const &prop_string, PropertyUnderlyingType prop_type)

Convert a string and type ID to a property.

Parse a string to create a property value according to the current input formats and the requested output type.

Return

Property parsed from string

Parameters
  • [in] prop_string: Property represented as string

  • [in] prop_type: Property type (see tracktable::PropertyUnderlyingType)

TimestampConverter *timestamp_converter()

Private Members

std::size_t DecimalPrecision
std::string NullValue
TimestampConverter TimestampReadWrite
std::ostringstream OutputBuf
std::istringstream InputBuf