MCPcopy Create free account
hub / github.com/apple/foundationdb / unprintable

Function unprintable

fdbclient/NativeAPI.actor.cpp:434–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434std::string unprintable(std::string const& val) {
435 std::string s;
436 for (int i = 0; i < val.size(); i++) {
437 char c = val[i];
438 if (c == '\\') {
439 if (++i == val.size())
440 ASSERT(false);
441 if (val[i] == '\\') {
442 s += '\\';
443 } else if (val[i] == 'x') {
444 if (i + 2 >= val.size())
445 ASSERT(false);
446 s += char((unhex(val[i + 1]) << 4) + unhex(val[i + 2]));
447 i += 2;
448 } else
449 ASSERT(false);
450 } else
451 s += c;
452 }
453 return s;
454}
455
456void DatabaseContext::validateVersion(Version version) const {
457 // Version could be 0 if the INITIALIZE_NEW_DATABASE option is set. In that case, it is illegal to perform any

Callers 7

Future<Void> KVFileDumpFunction · 0.85
CacheWorkloadMethod · 0.85
jsonToTenantMapEntryFunction · 0.85
MiniCycleWorkloadMethod · 0.85
CycleWorkloadMethod · 0.85
BulkLoadWorkloadMethod · 0.85

Calls 2

unhexFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected