Commit d9b29a05 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* src/misc/bareword.hh, src/misc/bareword.cc (quote_unless_bare_word):

New function.
parent 38f7cac8
2004-10-22 Alexandre Duret-Lutz <adl@src.lip6.fr>
* src/misc/bareword.hh, src/misc/bareword.cc (quote_unless_bare_word):
New function.
* src/ltlvisit/tostring.cc (to_spin_string_visitor): Move to
anonymous namespace.
......
......@@ -21,6 +21,7 @@
#include "bareword.hh"
#include <ctype.h>
#include "escape.hh"
namespace spot
{
......@@ -37,4 +38,14 @@ namespace spot
return false;
return true;
}
std::string
quote_unless_bare_word(const std::string& str)
{
if (is_bare_word(str.c_str()))
return str;
else
return "\"" + escape_str(str) + "\"";
}
}
......@@ -19,7 +19,11 @@
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
#include <string>
namespace spot
{
bool is_bare_word(const char* str);
std::string quote_unless_bare_word(const std::string& str);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment