Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
8c3690bb
Commit
8c3690bb
authored
4 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Add simox::alg::multi_to_string()
parent
c8a56895
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SimoxUtility/algorithm/string/string_tools.h
+26
-1
26 additions, 1 deletion
SimoxUtility/algorithm/string/string_tools.h
with
26 additions
and
1 deletion
SimoxUtility/algorithm/string/string_tools.h
+
26
−
1
View file @
8c3690bb
...
...
@@ -22,10 +22,14 @@
#pragma once
#include
<string>
#include
<sstream>
#include
<vector>
#include
<locale>
namespace
simox
::
alg
{
namespace
simox
::
alg
{
static
std
::
locale
DEFAULT_LOCALE
=
std
::
locale
::
classic
();
std
::
string
to_lower
(
const
std
::
string
&
str
);
...
...
@@ -57,4 +61,25 @@ namespace simox::alg {
bool
starts_with
(
std
::
string
const
&
input
,
std
::
string
const
&
search
);
bool
ends_with
(
std
::
string
const
&
input
,
std
::
string
const
&
search
);
template
<
typename
IterT
>
std
::
vector
<
std
::
string
>
multi_to_string
(
IterT
begin
,
IterT
end
)
{
std
::
vector
<
std
::
string
>
result
;
for
(
auto
it
=
begin
;
it
!=
end
;
++
it
)
{
std
::
stringstream
ss
;
ss
<<
*
it
;
result
.
push_back
(
ss
.
str
());
++
begin
;
}
return
result
;
}
template
<
typename
T
>
std
::
vector
<
std
::
string
>
multi_to_string
(
const
std
::
vector
<
T
>&
vector
)
{
return
multi_to_string
(
vector
.
begin
(),
vector
.
end
());
}
}
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