26#ifndef ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_JSON_PARSE_FILE_SHARING_OPTIONS_H_
27#define ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_JSON_PARSE_FILE_SHARING_OPTIONS_H_
72 template <
typename Container>
74 const std::string &
value) {
79 const std::string &
key,
const std::string &
value) {
84 template <
typename ValueType,
typename Container>
86 const std::string &
key,
const ValueType &vt,
95 template <
typename ValueType>
97 static const std::string kHttpContent =
"directoryIndexDirective.";
98 if (!
result_.directory_index_directive_.has_value()) {
99 result_.directory_index_directive_ = std::vector<std::string>{};
102 &
result_.directory_index_directive_.value());
105 template <
typename ValueType>
107 static const std::string kHttpContent =
"defaultStaticContent.";
108 static const std::string kHttpRedirects =
"defaultRedirects.";
112 &
result_.default_static_content_))
119 template <
typename ValueType>
static std::vector< uint8_t > decode(const std::string &encoded)
decode a base64 encoded string to binary.
Definition: base64.h:563
This class is a adapter for Reader from RapidJson.
Definition: rapid_json_to_struct.h:51
bool is_array_value()
Definition: rapid_json_to_struct.h:191
typename Parent::Ch Ch
Definition: rapid_json_to_struct.h:60
bool is_object_path()
Definition: rapid_json_to_struct.h:190
FileSharing result_
Definition: rapid_json_to_struct.h:188
std::string get_current_key() const
Definition: rapid_json_to_struct.h:194
Definition: parse_file_sharing_options.h:41
std::optional< std::vector< std::string > > directory_index_directive_
Definition: parse_file_sharing_options.h:45
std::map< std::string, std::string > default_static_content_
Definition: parse_file_sharing_options.h:43
std::map< std::string, std::string > default_redirects_
Definition: parse_file_sharing_options.h:44
Definition: parse_file_sharing_options.h:49
void handle_value(const ValueType &vt)
Definition: parse_file_sharing_options.h:120
bool String(const Ch *v, rapidjson::SizeType v_len, bool) override
Definition: parse_file_sharing_options.h:129
bool RawNumber(const Ch *v, rapidjson::SizeType v_len, bool) override
enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length)
Definition: parse_file_sharing_options.h:134
std::string to_string(const std::string &str)
Definition: parse_file_sharing_options.h:55
std::string from_base64(const T &str)
Definition: parse_file_sharing_options.h:64
void push_key_value(std::map< std::string, std::string > *c, const std::string &key, const std::string &value)
Definition: parse_file_sharing_options.h:78
bool Bool(bool v) override
Definition: parse_file_sharing_options.h:139
void handle_object_value(const std::string &key, const ValueType &vt)
Definition: parse_file_sharing_options.h:106
void handle_array_value(const std::string &key, const ValueType &vt)
Definition: parse_file_sharing_options.h:96
bool push_value_when_matches(const std::string &starts, const std::string &key, const ValueType &vt, Container *push_to)
Definition: parse_file_sharing_options.h:85
std::string to_string(const T &v)
Definition: parse_file_sharing_options.h:52
void push_key_value(Container *c, const std::string &, const std::string &value)
Definition: parse_file_sharing_options.h:73
std::string from_base64(const std::string &str)
Definition: parse_file_sharing_options.h:68
#define T
Definition: jit_executor_value.cc:373
static std::string to_string(const LEX_STRING &str)
Definition: lex_string.h:50
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1084
std::string as_string(const Container &c)
Definition: generic.h:44
bool starts_with(const String1 &value, const String2 &search_for)
Definition: contains.h:92
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
Definition: authorize_manager.h:48
typedef::std::uint64_t SizeType
Definition: my_rapidjson_size_t.h:39
required string key
Definition: replication_asynchronous_connection_failover.proto:60