MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / parse_float_list

Function parse_float_list

server/test/test_dflash.cpp:226–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224 char * end = nullptr;
225 long v = std::strtol(p, &end, 10);
226 if (end == p || v < 0 || v > INT32_MAX) return false;
227 out.push_back((int)v);
228 if (*end == '\0') break;
229 if (*end != ',') return false;
230 p = end + 1;
231 }
232 return !out.empty();
233}
234
235static bool parse_float_list(const char * text, std::vector<double> & out) {
236 out.clear();
237 if (!text || !*text) return false;
238 const char * p = text;
239 while (*p) {
240 char * end = nullptr;
241 double v = std::strtod(p, &end);
242 if (end == p || v <= 0.0) return false;
243 out.push_back(v);

Callers 1

mainFunction · 0.85

Calls 2

clearMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected