MCPcopy Create free account
hub / github.com/ElementsProject/elements / ValidAsCString

Function ValidAsCString

src/util/string.h:79–82  ·  view source on GitHub ↗

* Check if a string does not contain any embedded NUL (\0) characters */

Source from the content-addressed store, hash-verified

77 * Check if a string does not contain any embedded NUL (\0) characters
78 */
79[[nodiscard]] inline bool ValidAsCString(const std::string& str) noexcept
80{
81 return str.size() == strlen(str.c_str());
82}
83
84/**
85 * Locale-independent version of std::to_string

Callers 13

LookupInternFunction · 0.85
LookupHostFunction · 0.85
LookupFunction · 0.85
LookupNumericFunction · 0.85
LookupSubNetFunction · 0.85
SetSpecialMethod · 0.85
DecodeBase58Function · 0.85
DecodeBase58CheckFunction · 0.85
LegacyParsePrechecksFunction · 0.85
FUZZ_TARGETFunction · 0.85
DecodeBase64Function · 0.85
DecodeBase32Function · 0.85

Calls 1

sizeMethod · 0.45

Tested by 2

LegacyParsePrechecksFunction · 0.68
FUZZ_TARGETFunction · 0.68