umd/external/protobuf-2.6/gtest/fused-src/gtest/gtest-all.cc
String StrStreamToString(StrStream* ss) {
  const ::std::string& str = ss->str();
  const char* const start = str.c_str();
  const char* const end = start + str.length();

  // We need to use a helper StrStream to do this transformation
  // because String doesn't support push_back().
  StrStream helper;
  for (const char* ch = start; ch != end; ++ch) {
    if (*ch == '\0') {
      helper << "\\0";  // Replaces NUL with "\\0";
    } else {
      helper.put(*ch);
    }
  }

  return String(helper.str().c_str());
}
// Converts the buffer in a StrStream to a String, converting NUL
// bytes to "\\0" along the way.
Converts the buffer in a StrStream to a String, converting NUL
bytes to "\\0" along the way.
Converts the buffer in a StrStream to a String converting NUL bytes to " \\ 0 " along the way .
String StrStreamToString(StrStream* ss) {
  const ::std::string& str = ss->str();
  const char* const start = str.c_str();
  const char* const end = start + str.length();
  StrStream helper;
  for (const char* ch = start; ch != end; ++ch) {
    if (*ch == '\0') {
      helper << "\\0";  
    } else {
      helper.put(*ch);
    }
  }
  return String(helper.str().c_str());
}
String StrStreamToString ( StrStream * ss ) { const :: std :: string & str = ss -> str ( ) ; const char * const start = str . c_str ( ) ; const char * const end = start + str . length ( ) ; StrStream helper ; for ( const char * ch = start ; ch != end ; ++ ch ) { if ( * ch == ' \0 ' ) { helper << " \\ " ; } else { helper . put ( * ch ) ; } } return String ( helper . str ( ) . c_str ( ) ) ; }
Converts the buffer in a StrStream to a String, converting NUL
bytes to "\\0" along the way.
Converts the buffer in a StrStream to a String converting NUL bytes to " \\ 0 " along the way .
// We need to use a helper StrStream to do this transformation // because String doesn't support push_back(). // Replaces NUL with "\\0";