tensorflow_io/core/kernels/avro/utils/avro_parser_tree.cc
// TODO(fraudies): Replace by regex once tensorflow is compiled with GCC > 4.8
Replace by regex once tensorflow is compiled with GCC > 4.8
Replace by regex once tensorflow is compiled with GCC > 4 . 8
std::vector<string> SplitOnDelimiterButNotInsideSquareBrackets(
    const string& str, char delimiter) {
  std::vector<string> results;
  string lastMatch = "";
  int nBrackets = 0;
  for (const char& c : str) {
    nBrackets += (c == '[');
    nBrackets -= (c == ']');
    if (nBrackets == 0 && c == delimiter) {
      results.push_back(lastMatch);
      lastMatch = "";
    } else {
      lastMatch += c;
    }
  }
  results.push_back(lastMatch);
  return results;
}
std :: vector < string > SplitOnDelimiterButNotInsideSquareBrackets ( const string & str , char delimiter ) { std :: vector < string > results ; string lastMatch = " " ; int nBrackets = 0 ; for ( const char & c : str ) { nBrackets += ( c == ' ' ) ; nBrackets -= ( c == ' ' ) ; if ( nBrackets == 0 && c == delimiter ) { results . push_back ( lastMatch ) ; lastMatch = " " ; } else { lastMatch += c ; } } results . push_back ( lastMatch ) ; return results ; }
TODO(fraudies): Replace by regex once tensorflow is compiled with GCC > 4.8
TODO ( fraudies ) : Replace by regex once tensorflow is compiled with GCC > 4 . 8
// check that delimiter is not [ or ]