ltlcross: follow RFC 4180 for CSV output.
* src/misc/escape.cc, src/misc/escape.hh (escape_rfc4180): New function. * src/bin/ltlcross.cc: Do not output space after ',', use "\r\n" for end of line, and use escape_rfc4180(). * NEWS: Mention it.
This commit is contained in:
parent
925a807f4f
commit
1c5536ea9c
4 changed files with 81 additions and 53 deletions
|
|
@ -31,6 +31,22 @@
|
|||
|
||||
namespace spot
|
||||
{
|
||||
std::ostream&
|
||||
escape_rfc4180(std::ostream& os, const std::string& str)
|
||||
{
|
||||
for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
|
||||
switch (*i)
|
||||
{
|
||||
case '"':
|
||||
os << "\"\"";
|
||||
break;
|
||||
default:
|
||||
os << *i;
|
||||
break;
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
escape_str(std::ostream& os, const std::string& str)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue