Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pedi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
pedi
Commits
cf472752
Commit
cf472752
authored
2 months ago
by
Jason Hiser
Browse files
Options
Downloads
Patches
Plain Diff
Updates for c++17
parent
6cbb68d1
Branches
master
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SConscript
+1
-1
1 addition, 1 deletion
SConscript
pedi.cpp
+15
-0
15 additions, 0 deletions
pedi.cpp
with
16 additions
and
1 deletion
SConscript
+
1
−
1
View file @
cf472752
...
...
@@ -17,7 +17,7 @@ myenv=env.Clone()
#myenv=myenv.Clone(CPPPATH=Split(cpppath))
# $SECURITY_TRANSFORMS_HOME/libtransform/include
CPPFLAGS
=
"
--std=c++1
1
"
CPPFLAGS
=
"
--std=c++1
7
"
myenv
.
Append
(
CPPFLAGS
=
CPPFLAGS
)
#LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
...
...
This diff is collapsed.
Click to expand it.
pedi.cpp
+
15
−
0
View file @
cf472752
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment