| 151 | } |
| 152 | |
| 153 | std::optional<int32_t> GetConfigInt(Value const& node, std::string_view const& key) |
| 154 | { |
| 155 | auto v = node.FindMember(key.data()); |
| 156 | if (v != node.MemberEnd()) { |
| 157 | if (v->value.IsInt()) { |
| 158 | return v->value.GetInt(); |
| 159 | } else { |
| 160 | OsiError("Config option '" << key << "' should be an integer."); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | return {}; |
| 165 | } |
| 166 | |
| 167 | std::optional<STDString> GetConfigString(Value const& node, std::string_view const& key) |
| 168 | { |