tensorflow/core/util/command_line_flags_test.cc
// Return whether str==pat, but allowing any whitespace in pat
// to match zero or more whitespace characters in str.
Return whether str==pat, but allowing any whitespace in pat
to match zero or more whitespace characters in str.
Return whether str == pat but allowing any whitespace in pat to match zero or more whitespace characters in str .
static bool MatchWithAnyWhitespace(const string &str, const string &pat) {
  bool matching = true;
  int pat_i = 0;
  for (int str_i = 0; str_i != str.size() && matching; str_i++) {
    if (isspace(str[str_i])) {
      matching = (pat_i != pat.size() && isspace(pat[pat_i]));
    } else {
      while (pat_i != pat.size() && isspace(pat[pat_i])) {
        pat_i++;
      }
      matching = (pat_i != pat.size() && str[str_i] == pat[pat_i++]);
    }
  }
  while (pat_i != pat.size() && isspace(pat[pat_i])) {
    pat_i++;
  }
  return (matching && pat_i == pat.size());
}
static bool MatchWithAnyWhitespace ( const string & str , const string & pat ) { bool matching = true ; int pat_i = 0 ; for ( int str_i = 0 ; str_i != str . size ( ) && matching ; str_i ++ ) { if ( isspace ( str [ str_i ] ) ) { matching = ( pat_i != pat . size ( ) && isspace ( pat [ pat_i ] ) ) ; } else { while ( pat_i != pat . size ( ) && isspace ( pat [ pat_i ] ) ) { pat_i ++ ; } matching = ( pat_i != pat . size ( ) && str [ str_i ] == pat [ pat_i ++ ] ) ; } } while ( pat_i != pat . size ( ) && isspace ( pat [ pat_i ] ) ) { pat_i ++ ; } return ( matching && pat_i == pat . size ( ) ) ; }
Return whether str==pat, but allowing any whitespace in pat
to match zero or more whitespace characters in str.
Return whether str == pat but allowing any whitespace in pat to match zero or more whitespace characters in str .