Ninja
|
StringPiece represents a slice of a string whose memory is managed externally. More...
#include <string_piece.h>
Public Member Functions | |
string | AsString () const |
Convert the slice into a full-fledged std::string, copying the data into a new string. | |
bool | operator!= (const StringPiece &other) const |
bool | operator== (const StringPiece &other) const |
StringPiece () | |
StringPiece (const string &str) | |
The constructors intentionally allow for implicit conversions. | |
StringPiece (const char *str) | |
StringPiece (const char *str, size_t len) | |
Public Attributes | |
size_t | len_ |
const char * | str_ |
StringPiece represents a slice of a string whose memory is managed externally.
It is useful for reducing the number of std::strings we need to allocate.
Definition at line 27 of file string_piece.h.
StringPiece::StringPiece | ( | ) | [inline] |
Definition at line 28 of file string_piece.h.
StringPiece::StringPiece | ( | const string & | str | ) | [inline] |
The constructors intentionally allow for implicit conversions.
Definition at line 31 of file string_piece.h.
StringPiece::StringPiece | ( | const char * | str | ) | [inline] |
Definition at line 32 of file string_piece.h.
StringPiece::StringPiece | ( | const char * | str, |
size_t | len | ||
) | [inline] |
Definition at line 34 of file string_piece.h.
string StringPiece::AsString | ( | ) | const [inline] |
Convert the slice into a full-fledged std::string, copying the data into a new string.
Definition at line 45 of file string_piece.h.
Referenced by IncludesNormalize::AbsPath(), State::AddDefault(), State::AddOut(), EvalString::AddSpecial(), EvalString::AddText(), Lexer::Error(), State::GetNode(), ImplicitDepLoader::LoadDepFile(), and IncludesNormalize::Normalize().
bool StringPiece::operator!= | ( | const StringPiece & | other | ) | const [inline] |
Definition at line 39 of file string_piece.h.
bool StringPiece::operator== | ( | const StringPiece & | other | ) | const [inline] |
Definition at line 36 of file string_piece.h.
size_t StringPiece::len_ |
Definition at line 50 of file string_piece.h.
Referenced by EvalString::AddText(), EditDistance(), BuildLog::LogEntry::HashCommand(), __gnu_cxx::hash< StringPiece >::operator()(), and operator==().
const char* StringPiece::str_ |
Definition at line 49 of file string_piece.h.
Referenced by EvalString::AddText(), EditDistance(), Lexer::Error(), BuildLog::LogEntry::HashCommand(), __gnu_cxx::hash< StringPiece >::operator()(), operator==(), DepfileParser::Parse(), and Lexer::Start().