From fbcece555ad648cabbbf168d0646c71ecef75fc3 Mon Sep 17 00:00:00 2001 From: Jens Heuschkel Date: Mon, 21 Nov 2016 09:52:08 +0100 Subject: change function name according to convention; fix && problem --- src/uscxml/util/String.cpp | 5 +++-- src/uscxml/util/String.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uscxml/util/String.cpp b/src/uscxml/util/String.cpp index 7c89230..24c7d42 100644 --- a/src/uscxml/util/String.cpp +++ b/src/uscxml/util/String.cpp @@ -25,11 +25,12 @@ namespace uscxml { #define ISWHITESPACE(char) (isspace(char)) -std::string macro_escaped(std::string const& s) { +std::string escapedMacro(std::string const& s) { + // inspired by http://stackoverflow.com/questions/2417588/escaping-a-c-string std::string returnValue=""; for (std::string::const_iterator iter = s.begin(), end = s.end(); iter != end; ++iter) { char c = *iter; - if (' ' <= c and c <= '~' and c != '\\' and c != '"') { + if (' ' <= c && c <= '~' && c != '\\' && c != '"') { returnValue += c; } else { diff --git a/src/uscxml/util/String.h b/src/uscxml/util/String.h index b0832c8..9acd288 100644 --- a/src/uscxml/util/String.h +++ b/src/uscxml/util/String.h @@ -25,7 +25,7 @@ namespace uscxml { -std::string macro_escaped(std::string const& s); +std::string escapedMacro(std::string const& s); std::list tokenize(const std::string& line, const char seperator = ' ', bool trimWhiteSpace = true); std::string spaceNormalize(const std::string& text); bool nameMatch(const std::string& eventDescs, const std::string& event); -- cgit v0.12