MCPcopy Create free account
hub / github.com/cybozu/yrmcds / replace

Method replace

test/protocol_binary.cpp:300–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298 }
299
300 void replace(const std::string& key, const std::string& data, bool q,
301 std::uint32_t flags, std::uint32_t expire,
302 std::uint64_t cas = 0) {
303 char extra[8];
304 cybozu::hton(flags, extra);
305 cybozu::hton(expire, &extra[4]);
306 request req(q ? binary_command::ReplaceQ : binary_command::Replace,
307 (std::uint16_t)key.size(), key.data(),
308 sizeof(extra), extra,
309 (std::uint32_t)data.length(), data.data(),
310 nullptr, cas);
311 send(req.data(), req.length());
312 }
313
314 void add(const std::string& key, const std::string& data, bool q,
315 std::uint32_t flags, std::uint32_t expire, std::uint64_t cas = 0) {

Callers 1

AUTOTESTFunction · 0.80

Calls 4

htonFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected