src/lemon/graph_writer.h
changeset 1323 3aaadfb7de3d
parent 1297 fde0d12545c1
child 1333 2640cf6547ff
equal deleted inserted replaced
7:637005bfa8c5 8:411524653e75
    80     ///
    80     ///
    81     /// Writes a quoted string to the given stream.
    81     /// Writes a quoted string to the given stream.
    82     void write(std::ostream& os, const std::string& value) {
    82     void write(std::ostream& os, const std::string& value) {
    83       os << "\"";
    83       os << "\"";
    84       if (escaped) {
    84       if (escaped) {
    85 	ostringstream ls;
    85 	std::ostringstream ls;
    86 	for (int i = 0; i < (int)value.size(); ++i) {
    86 	for (int i = 0; i < (int)value.size(); ++i) {
    87 	  writeEscape(ls, value[i]);
    87 	  writeEscape(ls, value[i]);
    88 	}
    88 	}
    89 	os << ls.str();
    89 	os << ls.str();
    90       } else {
    90       } else {
   130       case '\v':
   130       case '\v':
   131 	os << "\\v";
   131 	os << "\\v";
   132 	return;
   132 	return;
   133       default:
   133       default:
   134 	if (c < 0x20) {
   134 	if (c < 0x20) {
   135 	  os << '\\' << oct << (int)c;
   135 	  os << '\\' << std::oct << (int)c;
   136 	} else {
   136 	} else {
   137 	  os << c;
   137 	  os << c;
   138 	}
   138 	}
   139 	return;
   139 	return;
   140       }     
   140       }