MCPcopy Create free account
hub / github.com/chen3feng/toft / data

Method data

base/string/string_piece.h:100–100  ·  view source on GitHub ↗

data() may return a pointer to a buffer with embedded NULs, and the returned buffer may or may not be null terminated. Therefore it is typically a mistake to pass data() to a routine that expects a NUL terminated string. Use "as_string().c_str()" if you really need to do this. Or better yet, change your routine so it does not rely on NUL termination.

Source from the content-addressed store, hash-verified

98 // this. Or better yet, change your routine so it does not rely on NUL
99 // termination.
100 const char* data() const { return m_ptr; }
101 size_t size() const { return m_length; }
102 size_t length() const { return m_length; }
103 bool empty() const { return m_length == 0; }

Callers 15

InsertMethod · 0.80
InsertUniqueMethod · 0.80
MayContainMethod · 0.80
InsertMethod · 0.80
MayContainMethod · 0.80
TESTFunction · 0.80
Get32Method · 0.80
Get64Method · 0.80
TESTFunction · 0.80
EncodeMethod · 0.80

Calls

no outgoing calls

Tested by 10

TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TEST_FFunction · 0.64
IoThreadMethod · 0.64
TestCompressionFunction · 0.64