MCPcopy Create free account
hub / github.com/MhmRdd/NoHello / xwrite

Function xwrite

module/src/main/cpp/utils.cpp:313–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311
312template <typename T>
313bool xwrite(int fd, const T& data) {
314 uint64_t size = sizeof(T);
315 if (write(fd, &size, sizeof(size)) != sizeof(size)) {
316 return false;
317 }
318 if (write(fd, data.data(), size) != static_cast<ssize_t>(size)) {
319 return false;
320 }
321 return true;
322}
323
324template<>
325bool xwrite<std::string>(int fd, const std::string& data) {

Callers 1

NoRootFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected