MCPcopy Create free account
hub / github.com/apache/brpc / BasicStringPiece

Method BasicStringPiece

src/butil/strings/string_piece.h:184–184  ·  view source on GitHub ↗

We provide non-explicit singleton constructors so users can pass in a "const char*" or a "string" wherever a "StringPiece" is expected (likewise for char16, string16, StringPiece16).

Source from the content-addressed store, hash-verified

182 // in a "const char*" or a "string" wherever a "StringPiece" is
183 // expected (likewise for char16, string16, StringPiece16).
184 BasicStringPiece() : ptr_(NULL), length_(0) {}
185 BasicStringPiece(const value_type* str)
186 : ptr_(str),
187 length_((str == NULL) ? 0 : STRING_TYPE::traits_type::length(str)) {}

Callers

nothing calls this directly

Calls 4

lengthFunction · 0.70
dataMethod · 0.45
sizeMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected