summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJens Heuschkel <heuschkel@tk.tu-darmstadt.de>2016-11-21 08:52:08 (GMT)
committerJens Heuschkel <heuschkel@tk.tu-darmstadt.de>2016-11-21 08:52:08 (GMT)
commitfbcece555ad648cabbbf168d0646c71ecef75fc3 (patch)
tree254a0e23b05176372f2a20b85183ddaaae7a27b9 /src
parent67677c3ba75c487bc0f06ea6c683c5c187f8da17 (diff)
downloaduscxml-fbcece555ad648cabbbf168d0646c71ecef75fc3.zip
uscxml-fbcece555ad648cabbbf168d0646c71ecef75fc3.tar.gz
uscxml-fbcece555ad648cabbbf168d0646c71ecef75fc3.tar.bz2
change function name according to convention; fix && problem
Diffstat (limited to 'src')
-rw-r--r--src/uscxml/util/String.cpp5
-rw-r--r--src/uscxml/util/String.h2
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);