MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / parseBoolean

Function parseBoolean

lib/config/proto.cc:167–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167static bool parseBoolean(const std::string& value)
168{
169 static const std::map<std::string, bool> boolvalues = {
170 {"false", false},
171 {"f", false},
172 {"no", false},
173 {"n", false},
174 {"0", false},
175 {"true", true },
176 {"t", true },
177 {"yes", true },
178 {"y", true },
179 {"1", true },
180 };
181
182 const auto& it = boolvalues.find(value);
183 if (it == boolvalues.end())
184 error("invalid boolean value");
185 return it->second;
186}
187
188static int32_t parseEnum(
189 const google::protobuf::FieldDescriptor* field, const std::string& value)

Callers 1

setMethod · 0.85

Calls 3

errorFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected