folly::settings::SettingValueAndMetadata

Type containing the string representation of a setting as well as the static metadata associated with it. Used as the "source" in setting conversion.

Synopsis

Declared in <folly/settings/Types.h>

struct SettingValueAndMetadata;

Member Functions

NameDescription
SettingValueAndMetadata [constructor]Constructs a value and metadata pair from a string value and metadata.

Data Members

NameDescription
meta The static metadata associated with the setting.
value The string representation of the setting value.

Non-Member Functions

NameDescription
convertToLike parseTo in folly/Conv.h, but the "source" is SettingValueAndMetadata instead of a StringPiece. Defaults to folly::tryTo<T>(StringPiece) but can be overridden using ADL for user defined types.
toConverts a setting value and metadata to type T, throwing on error.
tryToConversion functions for converting a SettingValueAndMetadata to a setting type T. Implementation is similar to folly/Conv and allows for customization using the convertTo function above.