Imported Upstream version 17.25.4
[platform/upstream/libzypp.git] / zypp / base / StringV.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/base/StringV.cc
10  */
11
12 #include <zypp/base/StringV.h>
13
14 ///////////////////////////////////////////////////////////////////
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), std::string(sep_r), str::TRIM );
26
27       if ( fnc_r ) {
28         for ( const auto & w : words )
29           fnc_r( std::string_view(w) );
30       }
31       return words.size();
32     }
33
34   } // namespace strv
35 } // namespace zypp
36 ///////////////////////////////////////////////////////////////////