git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Removed "using namespace std;" from rscriptd.
[stg.git]
/
stglibs
/
common.lib
/
common.cpp
diff --git
a/stglibs/common.lib/common.cpp
b/stglibs/common.lib/common.cpp
index 5bd66c8798d879ec5193c8a3a36e9845c45d6539..1068cfa12ed085351486dd462b844cc7603a4d73 100644
(file)
--- a/
stglibs/common.lib/common.cpp
+++ b/
stglibs/common.lib/common.cpp
@@
-1047,3
+1047,16
@@
while (done < size)
}
return true;
}
+
+std::string ToPrintable(const std::string & src)
+{
+ std::string dest;
+
+ for (size_t i = 0; i < src.size(); ++i)
+ if (std::isprint(src[i]))
+ dest += src[i];
+ else
+ dest += "\\" + x2str(src[i]);
+
+ return dest;
+}