Lines Matching refs:str
117 // Returns true iff regular expression re matches the entire str.
118 bool RE::FullMatch(const char* str, const RE& re) {
122 return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
125 // Returns true iff regular expression re matches a substring of str
126 // (including str itself).
127 bool RE::PartialMatch(const char* str, const RE& re) {
131 return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
165 // Returns true iff ch appears anywhere in str (excluding the
167 bool IsInSet(char ch, const char* str) {
168 return ch != '\0' && strchr(str, ch) != NULL;
280 // or +). The behavior is undefined if str contains too many
286 const char* str) {
294 // We know that the atom matches each of the first i characters in str.
295 if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
297 // Since we only care about *whether* the pattern matches str
302 if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
308 // Returns true iff regex matches a prefix of str. regex must be a
311 bool MatchRegexAtHead(const char* regex, const char* str) {
318 return *str == '\0';
329 escaped, regex[0], regex[1], regex + 2, str);
333 // character of str and recurse.
334 return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
335 MatchRegexAtHead(regex + 1, str + 1);
339 // Returns true iff regex matches any substring of str. regex must be
347 bool MatchRegexAnywhere(const char* regex, const char* str) {
348 if (regex == NULL || str == NULL)
352 return MatchRegexAtHead(regex + 1, str);
354 // A successful match can be anywhere in str.
356 if (MatchRegexAtHead(regex, str))
358 } while (*str++ != '\0');
369 // Returns true iff regular expression re matches the entire str.
370 bool RE::FullMatch(const char* str, const RE& re) {
371 return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
374 // Returns true iff regular expression re matches a substring of str
375 // (including str itself).
376 bool RE::PartialMatch(const char* str, const RE& re) {
377 return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
596 // Parses 'str' for a 32-bit signed integer. If successful, writes
599 bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
602 const long long_value = strtol(str, &end, 10); // NOLINT
610 << " has value \"" << str << "\".\n";
627 << " has value " << str << ", which overflows.\n";