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

Method GetLengthPrefixedStringPiece

encoding/varint.cpp:164–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164const char* Varint::GetLengthPrefixedStringPiece(const char* p,
165 const char* limit,
166 StringPiece* result) {
167 uint32_t len;
168 p = Decode32(p, limit, &len);
169 if (p == NULL)
170 return NULL;
171 if (p + len > limit)
172 return NULL;
173 *result = StringPiece(p, len);
174 return p + len;
175}
176
177bool Varint::GetLengthPrefixedStringPiece(StringPiece* input, StringPiece* result) {
178 uint32_t len;

Callers

nothing calls this directly

Calls 4

StringPieceClass · 0.85
dataMethod · 0.80
remove_prefixMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected