MCPcopy Create free account
hub / github.com/antvis/F2Native / GetString

Function GetString

core/graphics/util/json.cpp:57–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57const std::string GetString(const nlohmann::json &obj, const std::string &key, const std::string &def) {
58 if(obj.is_object() && obj.contains(key) && obj[key].is_string()) {
59 return obj[key].get<std::string>();
60 } else {
61 return def;
62 }
63}
64
65const double GetNumber(const nlohmann::json &obj, const std::string &key, const double def) {
66 if(obj.is_object() && obj.contains(key) && obj[key].is_number()) {

Callers 15

InvokeMethodMethod · 0.85
CompatScalesMethod · 0.85
CompatScaleMethod · 0.85
ParseObjectMethod · 0.85
InitConfigMethod · 0.85
InitConfigMethod · 0.85
OnBeforeCanvasDrawMethod · 0.85
SetXTipContentMethod · 0.85
SetYTipContentMethod · 0.85
_ShowSnapMethod · 0.85
_ShowCrosshairsMethod · 0.85
ShowToolTipsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected