Lines Matching refs:str
42 const StringPiece& str, char sep, const std::function<char(char)>& f) { in SplitAndTransform() argument
44 const StringPiece::const_iterator end = std::end(str); in SplitAndTransform()
45 StringPiece::const_iterator start = std::begin(str); in SplitAndTransform()
49 parts.emplace_back(str.substr(start, current).to_string()); in SplitAndTransform()
59 std::vector<std::string> Split(const StringPiece& str, char sep) { in Split() argument
60 return SplitAndTransform(str, sep, nullptr); in Split()
63 std::vector<std::string> SplitAndLowercase(const StringPiece& str, char sep) { in SplitAndLowercase() argument
64 return SplitAndTransform(str, sep, ::tolower); in SplitAndLowercase()
67 bool StartsWith(const StringPiece& str, const StringPiece& prefix) { in StartsWith() argument
68 if (str.size() < prefix.size()) { in StartsWith()
71 return str.substr(0, prefix.size()) == prefix; in StartsWith()
74 bool EndsWith(const StringPiece& str, const StringPiece& suffix) { in EndsWith() argument
75 if (str.size() < suffix.size()) { in EndsWith()
78 return str.substr(str.size() - suffix.size(), suffix.size()) == suffix; in EndsWith()
81 StringPiece TrimLeadingWhitespace(const StringPiece& str) { in TrimLeadingWhitespace() argument
82 if (str.size() == 0 || str.data() == nullptr) { in TrimLeadingWhitespace()
83 return str; in TrimLeadingWhitespace()
86 const char* start = str.data(); in TrimLeadingWhitespace()
87 const char* end = start + str.length(); in TrimLeadingWhitespace()
95 StringPiece TrimTrailingWhitespace(const StringPiece& str) { in TrimTrailingWhitespace() argument
96 if (str.size() == 0 || str.data() == nullptr) { in TrimTrailingWhitespace()
97 return str; in TrimTrailingWhitespace()
100 const char* start = str.data(); in TrimTrailingWhitespace()
101 const char* end = start + str.length(); in TrimTrailingWhitespace()
109 StringPiece TrimWhitespace(const StringPiece& str) { in TrimWhitespace() argument
110 if (str.size() == 0 || str.data() == nullptr) { in TrimWhitespace()
111 return str; in TrimWhitespace()
114 const char* start = str.data(); in TrimWhitespace()
115 const char* end = str.data() + str.length(); in TrimWhitespace()
128 static int IsJavaNameImpl(const StringPiece& str) { in IsJavaNameImpl() argument
130 for (const StringPiece& piece : Tokenize(str, '.')) { in IsJavaNameImpl()
139 bool IsJavaClassName(const StringPiece& str) { in IsJavaClassName() argument
140 return IsJavaNameImpl(str) >= 2; in IsJavaClassName()
143 bool IsJavaPackageName(const StringPiece& str) { in IsJavaPackageName() argument
144 return IsJavaNameImpl(str) >= 1; in IsJavaPackageName()
147 static int IsAndroidNameImpl(const StringPiece& str) { in IsAndroidNameImpl() argument
149 for (const StringPiece& piece : Tokenize(str, '.')) { in IsAndroidNameImpl()
171 bool IsAndroidPackageName(const StringPiece& str) { in IsAndroidPackageName() argument
172 return IsAndroidNameImpl(str) > 1 || str == "android"; in IsAndroidPackageName()
175 bool IsAndroidSplitName(const StringPiece& str) { in IsAndroidSplitName() argument
176 return IsAndroidNameImpl(str) > 0; in IsAndroidSplitName()
230 bool VerifyJavaStringFormat(const StringPiece& str) { in VerifyJavaStringFormat() argument
231 const char* c = str.begin(); in VerifyJavaStringFormat()
232 const char* const end = str.end(); in VerifyJavaStringFormat()
503 Tokenizer::Tokenizer(const StringPiece& str, char sep) in Tokenizer() argument
504 : begin_(++iterator(str, sep, StringPiece(str.begin() - 1, 0), false)), in Tokenizer()
505 end_(str, sep, StringPiece(str.end(), 0), true) {} in Tokenizer()
535 const char16_t* str = pool.stringAt(idx, &len); in GetString16() local
536 if (str != nullptr) { in GetString16()
537 return StringPiece16(str, len); in GetString16()
544 const char* str = pool.string8At(idx, &len); in GetString() local
545 if (str != nullptr) { in GetString()
546 return ModifiedUtf8ToUtf8(std::string(str, len)); in GetString()