20 const std::string separator_;
21 const std::string escape_seq_;
22 const std::string special_chars_;
30 , special_chars_(
"\"")
32 fs_.exceptions(std::ios::failbit | std::ios::badbit);
33 fs_.open(filename.c_str());
66 return write(escape(
val));
71 return write(escape(
val));
96 std::string escape(
const std::string &
val)
100 std::string::size_type to, from = 0u, len =
val.length();
101 while (from < len && std::string::npos != (to =
val.find_first_of(special_chars_, from)))
103 result <<
val.substr(from, to - from) << escape_seq_ <<
val[to];