| 83 | void Fail() { obj_ = std::nullopt; } |
| 84 | |
| 85 | void Init(std::string_view class_name, std::string_view repr, size_t num_properties) { |
| 86 | if (!repr.starts_with(class_name)) return Fail(); |
| 87 | |
| 88 | repr = repr.substr(class_name.size()); |
| 89 | if (repr.empty()) return Fail(); |
| 90 | if (repr.front() != '{') return Fail(); |
| 91 | if (repr.back() != '}') return Fail(); |
| 92 | |
| 93 | repr = repr.substr(1, repr.size() - 2); |
| 94 | members_ = SplitString(repr, ','); |
| 95 | if (members_.size() != num_properties) return Fail(); |
| 96 | } |
| 97 | |
| 98 | template <typename Property> |
| 99 | void operator()(const Property& prop, size_t i) { |
nothing calls this directly
no test coverage detected