| 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); |
no test coverage detected