MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / parse_box

Function parse_box

tests/test_phase6.cpp:55–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static 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
75static std::vector<phase6_case> load_cases(const std::string & path) {
76 std::vector<phase6_case> cases;

Callers 1

load_casesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected