mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Templatise tokenizeString()
This commit is contained in:
parent
00092b2d35
commit
76e88871b2
10 changed files with 30 additions and 39 deletions
|
@ -984,9 +984,9 @@ void _interrupted()
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Strings tokenizeString(const string & s, const string & separators)
|
||||
template<class C> C tokenizeString(const string & s, const string & separators)
|
||||
{
|
||||
Strings result;
|
||||
C result;
|
||||
string::size_type pos = s.find_first_not_of(separators, 0);
|
||||
while (pos != string::npos) {
|
||||
string::size_type end = s.find_first_of(separators, pos + 1);
|
||||
|
@ -998,6 +998,9 @@ Strings tokenizeString(const string & s, const string & separators)
|
|||
return result;
|
||||
}
|
||||
|
||||
template Strings tokenizeString(const string & s, const string & separators);
|
||||
template vector<string> tokenizeString(const string & s, const string & separators);
|
||||
|
||||
|
||||
string concatStringsSep(const string & sep, const Strings & ss)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue