MCPcopy Create free account
hub / github.com/apache/thrift / get_integer

Method get_integer

compiler/cpp/src/thrift/parse/t_const_value.h:67–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 int64_t get_integer() const {
68 if (valType_ == CV_IDENTIFIER) {
69 if (enum_ == nullptr) {
70 throw "have identifier \"" + get_identifier() + "\", but unset enum on line!";
71 }
72 std::string identifier = get_identifier();
73 std::string::size_type dot = identifier.rfind('.');
74 if (dot != std::string::npos) {
75 identifier = identifier.substr(dot + 1);
76 }
77 t_enum_value* val = enum_->get_constant_by_name(identifier);
78 if (val == nullptr) {
79 throw "Unable to find enum value \"" + identifier + "\" in enum \"" + enum_->get_name()
80 + "\"";
81 }
82 return val->get_value();
83 } else {
84 return intVal_;
85 }
86 }
87
88 void set_uuid(std::string val) {
89 validate_uuid(val);

Callers 15

compare_defaultsFunction · 0.80
resolve_const_valueMethod · 0.80
print_const_valueMethod · 0.80
render_const_valueMethod · 0.80
write_const_valueMethod · 0.80
render_const_valueMethod · 0.80
render_const_valueMethod · 0.80
render_const_valueMethod · 0.80
render_const_valueMethod · 0.80
render_const_valueMethod · 0.80
render_const_valueMethod · 0.80
render_const_valueMethod · 0.80

Calls 4

get_constant_by_nameMethod · 0.80
substrMethod · 0.45
get_nameMethod · 0.45
get_valueMethod · 0.45

Tested by

no test coverage detected