MySQL 8.4.2
Source Code Documentation
anonymous_namespace{cluster_metadata_instance_attributes.cc} Namespace Reference

Functions

stdx::expected< std::optional< std::string >, std::string > get_string_attribute (const std::string_view &attributes, const std::string_view &name)
 Returns value for the string field set in the attributes. More...
 
stdx::expected< bool, std::string > get_bool_tag (const std::string_view &attributes, const std::string_view &name, bool default_value)
 Returns value for the boolean field set in the attributes. More...
 

Function Documentation

◆ get_bool_tag()

stdx::expected< bool, std::string > anonymous_namespace{cluster_metadata_instance_attributes.cc}::get_bool_tag ( const std::string_view &  attributes,
const std::string_view &  name,
bool  default_value 
)

Returns value for the boolean field set in the attributes.

Parameters
attributesstring containing JSON with the attributes
namename of the field to be fetched
default_valuevalue to be returned in case the given attribute is not present in the JSON
Return values
valueof the attribute JSON field as boolean
std::nullptrif the given field is missing
errormessage if reading attribute from JSON failed.

◆ get_string_attribute()

stdx::expected< std::optional< std::string >, std::string > anonymous_namespace{cluster_metadata_instance_attributes.cc}::get_string_attribute ( const std::string_view &  attributes,
const std::string_view &  name 
)

Returns value for the string field set in the attributes.

Parameters
attributesstring containing JSON with the attributes
namename of the field to be fetched
Return values
valueof the attribute JSON field as string
std::nullptrif the given field is missing
errormessage if reading attribute from JSON failed.