MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / GetAnyValueF

Function GetAnyValueF

native/thirdpart/flatbuffers/reflection.cpp:52–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52double GetAnyValueF(reflection::BaseType type, const uint8_t *data) {
53 switch (type) {
54 case reflection::Float: return static_cast<double>(ReadScalar<float>(data));
55 case reflection::Double: return ReadScalar<double>(data);
56 case reflection::String: {
57 auto s =
58 reinterpret_cast<const String *>(ReadScalar<uoffset_t>(data) + data);
59 if (s) {
60 double d;
61 StringToNumber(s->c_str(), &d);
62 return d;
63 } else {
64 return 0.0;
65 }
66 }
67 default: return static_cast<double>(GetAnyValueI(type, data));
68 }
69}
70
71std::string GetAnyValueS(reflection::BaseType type, const uint8_t *data,
72 const reflection::Schema *schema, int type_index) {

Callers 3

GetAnyFieldFFunction · 0.85
GetAnyVectorElemFFunction · 0.85
GetAnyValueSFunction · 0.85

Calls 3

StringToNumberFunction · 0.85
GetAnyValueIFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected