libzypp
17.24.2
StringV.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#include <
zypp/base/StringV.h
>
13
15
namespace
zypp
16
{
17
namespace
strv
18
{
19
20
unsigned
split
( std::string_view line_r, std::string_view sep_r,
Trim
trim_r,
21
std::function<
void
(std::string_view)> fnc_r )
22
{
23
#warning REIMPLEMENT
24
std::vector<std::string> words;
25
str::split
( std::string(line_r), std::back_inserter(words),
","
,
str::TRIM
);
26
if
( fnc_r ) {
27
for
(
const
auto
& w : words )
28
fnc_r( std::string_view(w) );
29
}
30
return
words.size();
31
}
32
33
}
// namespace strv
34
}
// namespace zypp
zypp::str::Trim
Trim
To define how to trim.
Definition:
String.h:493
zypp::str::TRIM
@ TRIM
Definition:
String.h:497
zypp::str::split
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Definition:
String.h:527
zypp::strv::split
unsigned split(std::string_view line_r, std::string_view sep_r, Trim trim_r, std::function< void(std::string_view)> fnc_r)
Definition:
StringV.cc:20
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition:
CodePitfalls.doc:2
StringV.h
zypp
base
StringV.cc
Generated by
1.8.18