Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • opensrc/pedi
1 result
Show changes
Commits on Source (1)
......@@ -17,7 +17,7 @@ myenv=env.Clone()
#myenv=myenv.Clone(CPPPATH=Split(cpppath))
# $SECURITY_TRANSFORMS_HOME/libtransform/include
CPPFLAGS="--std=c++11"
CPPFLAGS="--std=c++17"
myenv.Append(CPPFLAGS=CPPFLAGS)
#LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
......
......@@ -17,6 +17,9 @@
#include <limits.h>
#include <stdlib.h>
#include <assert.h>
#include <algorithm>
#include <cctype>
#include <string>
using namespace std;
......@@ -196,6 +199,7 @@ void parse_args(int argc, char* argv[])
}
/*
// trim from start (in place)
static inline void ltrim(std::string &s) {
......@@ -208,6 +212,17 @@ static inline void rtrim(std::string &s) {
s.erase(std::find_if(s.rbegin(), s.rend(),
std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
}
*/
static inline void ltrim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(),
[](unsigned char ch) { return !std::isspace(ch); }));
}
static inline void rtrim(std::string &s) {
s.erase(std::find_if(s.rbegin(), s.rend(),
[](unsigned char ch) { return !std::isspace(ch); }).base(), s.end());
}
// trim from both ends (in place)
static inline void trim(std::string &s) {
......