| 53 | } |
| 54 | |
| 55 | static bool parse_box(const std::string & field, sam3_box & box) { |
| 56 | if (field.empty()) { |
| 57 | return false; |
| 58 | } |
| 59 | |
| 60 | float vals[4]; |
| 61 | size_t start = 0; |
| 62 | for (int i = 0; i < 4; ++i) { |
| 63 | size_t end = field.find(':', start); |
| 64 | if (end == std::string::npos) { |
| 65 | end = field.size(); |
| 66 | } |
| 67 | vals[i] = std::stof(field.substr(start, end - start)); |
| 68 | start = end + 1; |
| 69 | } |
| 70 | |
| 71 | box = {vals[0], vals[1], vals[2], vals[3]}; |
| 72 | return true; |
| 73 | } |
| 74 | |
| 75 | static std::vector<phase6_case> load_cases(const std::string & path) { |
| 76 | std::vector<phase6_case> cases; |