Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
e75c0e68
Commit
e75c0e68
authored
Nov 19, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing split overloads
parent
3c36954c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
libcaf_core/caf/string_algorithms.hpp
libcaf_core/caf/string_algorithms.hpp
+6
-0
libcaf_core/src/string_algorithms.cpp
libcaf_core/src/string_algorithms.cpp
+10
-0
No files found.
libcaf_core/caf/string_algorithms.hpp
View file @
e75c0e68
...
@@ -46,6 +46,12 @@ void split(std::vector<std::string>& result, string_view str,
...
@@ -46,6 +46,12 @@ void split(std::vector<std::string>& result, string_view str,
void
split
(
std
::
vector
<
string_view
>&
result
,
string_view
str
,
void
split
(
std
::
vector
<
string_view
>&
result
,
string_view
str
,
string_view
delims
,
bool
keep_all
=
true
);
string_view
delims
,
bool
keep_all
=
true
);
void
split
(
std
::
vector
<
std
::
string
>&
result
,
string_view
str
,
char
delim
,
bool
keep_all
=
true
);
void
split
(
std
::
vector
<
string_view
>&
result
,
string_view
str
,
char
delim
,
bool
keep_all
=
true
);
template
<
class
InputIterator
>
template
<
class
InputIterator
>
std
::
string
join
(
InputIterator
first
,
InputIterator
last
,
string_view
glue
)
{
std
::
string
join
(
InputIterator
first
,
InputIterator
last
,
string_view
glue
)
{
if
(
first
==
last
)
if
(
first
==
last
)
...
...
libcaf_core/src/string_algorithms.cpp
View file @
e75c0e68
...
@@ -56,6 +56,16 @@ void split(std::vector<string_view>& result, string_view str,
...
@@ -56,6 +56,16 @@ void split(std::vector<string_view>& result, string_view str,
return
split_impl
(
f
,
str
,
delims
,
keep_all
);
return
split_impl
(
f
,
str
,
delims
,
keep_all
);
}
}
void
split
(
std
::
vector
<
std
::
string
>&
result
,
string_view
str
,
char
delim
,
bool
keep_all
)
{
split
(
result
,
str
,
string_view
{
&
delim
,
1
},
keep_all
);
}
void
split
(
std
::
vector
<
string_view
>&
result
,
string_view
str
,
char
delim
,
bool
keep_all
)
{
split
(
result
,
str
,
string_view
{
&
delim
,
1
},
keep_all
);
}
void
replace_all
(
std
::
string
&
str
,
string_view
what
,
string_view
with
)
{
void
replace_all
(
std
::
string
&
str
,
string_view
what
,
string_view
with
)
{
// end(what) - 1 points to the null-terminator
// end(what) - 1 points to the null-terminator
auto
next
=
[
&
](
std
::
string
::
iterator
pos
)
->
std
::
string
::
iterator
{
auto
next
=
[
&
](
std
::
string
::
iterator
pos
)
->
std
::
string
::
iterator
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment