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

Function parse_inline_snap

server/src/common/daemon_loop.cpp:186–199  ·  view source on GitHub ↗

Parse optional inline-snap suffix: ` snap= : `.

Source from the content-addressed store, hash-verified

184
185static bool write_counted_i32(const std::string & path,
186 const std::vector<int32_t> & ids) {
187 std::ofstream f(path, std::ios::binary);
188 if (!f) return false;
189 uint32_t n = (uint32_t)ids.size();
190 f.write(reinterpret_cast<const char *>(&n), sizeof(n));
191 if (n > 0)
192 f.write(reinterpret_cast<const char *>(ids.data()),
193 (std::streamsize)ids.size() * sizeof(int32_t));
194 return (bool)f;
195}
196
197// Parse optional inline-snap suffix: ` snap=<pos>:<slot>`.
198static void parse_inline_snap(const std::string & line,
199 int & snap_pos, int & snap_slot) {
200 snap_pos = -1;
201 snap_slot = -1;
202 size_t p = line.find(" snap=");

Callers 1

run_daemonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected