MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / rioWriteBulkString

Function rioWriteBulkString

src/rio.cpp:467–474  ·  view source on GitHub ↗

Write binary-safe string in the format: "$ \r\n \r\n". */

Source from the content-addressed store, hash-verified

465
466/* Write binary-safe string in the format: "$<count>\r\n<payload>\r\n". */
467size_t rioWriteBulkString(rio *r, const char *buf, size_t len) {
468 size_t nwritten;
469
470 if ((nwritten = rioWriteBulkCount(r,'$',len)) == 0) return 0;
471 if (len > 0 && rioWrite(r,buf,len) == 0) return 0;
472 if (rioWrite(r,"\r\n",2) == 0) return 0;
473 return nwritten+len+2;
474}
475
476/* Write a long long value in format: "$<count>\r\n<payload>\r\n". */
477size_t rioWriteBulkLongLong(rio *r, long long l) {

Callers 13

migrateCommandFunction · 0.85
rioWriteBulkLongLongFunction · 0.85
rioWriteBulkDoubleFunction · 0.85
rioWriteBulkObjectFunction · 0.85
rewriteListObjectFunction · 0.85
rewriteSetObjectFunction · 0.85
rewriteSortedSetObjectFunction · 0.85
rewriteHashObjectFunction · 0.85
rioWriteBulkStreamIDFunction · 0.85

Calls 2

rioWriteBulkCountFunction · 0.85
rioWriteFunction · 0.85

Tested by

no test coverage detected