|
Ninja
|
StringPiece represents a slice of a string whose memory is managed externally. More...
#include <string_piece.h>
Public Types | |
| typedef const char * | const_iterator |
Public Member Functions | |
| std::string | AsString () const |
| Convert the slice into a full-fledged std::string, copying the data into a new string. More... | |
| const_iterator | begin () const |
| size_t | empty () const |
| const_iterator | end () const |
| bool | operator!= (const StringPiece &other) const |
| bool | operator== (const StringPiece &other) const |
| char | operator[] (size_t pos) const |
| size_t | size () const |
| StringPiece () | |
| StringPiece (const char *str) | |
| StringPiece (const char *str, size_t len) | |
| StringPiece (const std::string &str) | |
| The constructors intentionally allow for implicit conversions. More... | |
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 25 of file string_piece.h.
| typedef const char* StringPiece::const_iterator |
Definition at line 26 of file string_piece.h.
|
inline |
Definition at line 28 of file string_piece.h.
|
inline |
The constructors intentionally allow for implicit conversions.
Definition at line 31 of file string_piece.h.
|
inline |
Definition at line 32 of file string_piece.h.
|
inline |
Definition at line 34 of file string_piece.h.
|
inline |
Convert the slice into a full-fledged std::string, copying the data into a new string.
Definition at line 46 of file string_piece.h.
Referenced by IncludesNormalize::AbsPath(), State::AddDefault(), State::AddOut(), EvalString::AddSpecial(), EvalString::AddText(), State::GetNode(), IncludesNormalize::Normalize(), Jobserver::ParseMakeFlagsValue(), and BuildLog::Restat().
|
inline |
Definition at line 50 of file string_piece.h.
References str_.
Referenced by EvalString::AddText(), and SplitStringPiece().
|
inline |
Definition at line 66 of file string_piece.h.
References len_.
|
inline |
Definition at line 54 of file string_piece.h.
Referenced by EvalString::AddText(), and SplitStringPiece().
|
inline |
Definition at line 40 of file string_piece.h.
|
inline |
Definition at line 36 of file string_piece.h.
|
inline |
Definition at line 58 of file string_piece.h.
References str_.
|
inline |
Definition at line 62 of file string_piece.h.
References len_.
| size_t StringPiece::len_ |
Definition at line 71 of file string_piece.h.
Referenced by AsString(), EditDistance(), empty(), end(), EqualsCaseInsensitiveASCII(), BuildLog::LogEntry::HashCommand(), std::hash< StringPiece >::operator()(), operator==(), and size().
| const char* StringPiece::str_ |
Definition at line 70 of file string_piece.h.
Referenced by AsString(), begin(), EditDistance(), end(), EqualsCaseInsensitiveASCII(), BuildLog::LogEntry::HashCommand(), std::hash< StringPiece >::operator()(), operator==(), operator[](), BuildLog::Restat(), and Lexer::Start().