diff options
author | Jens Heuschkel <heuschkel@tk.tu-darmstadt.de> | 2016-11-21 08:52:08 (GMT) |
---|---|---|
committer | Jens Heuschkel <heuschkel@tk.tu-darmstadt.de> | 2016-11-21 08:52:08 (GMT) |
commit | fbcece555ad648cabbbf168d0646c71ecef75fc3 (patch) | |
tree | 254a0e23b05176372f2a20b85183ddaaae7a27b9 | |
parent | 67677c3ba75c487bc0f06ea6c683c5c187f8da17 (diff) | |
download | uscxml-fbcece555ad648cabbbf168d0646c71ecef75fc3.zip uscxml-fbcece555ad648cabbbf168d0646c71ecef75fc3.tar.gz uscxml-fbcece555ad648cabbbf168d0646c71ecef75fc3.tar.bz2 |
change function name according to convention; fix && problem
-rw-r--r-- | src/uscxml/util/String.cpp | 5 | ||||
-rw-r--r-- | 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<std::string> 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); |