2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
// author: Max Kellermann <max.kellermann@gmail.com>
|
2014-12-03 21:39:45 +01:00
|
|
|
|
2022-07-01 11:13:43 +02:00
|
|
|
#pragma once
|
2014-12-03 21:39:45 +01:00
|
|
|
|
|
|
|
#include <forward_list>
|
2020-04-03 16:38:55 +02:00
|
|
|
#include <string_view>
|
2014-12-03 21:39:45 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Split a string at a certain separator character into sub strings
|
|
|
|
* and returns a list of these.
|
|
|
|
*
|
|
|
|
* Two consecutive separator characters result in an empty string in
|
|
|
|
* the list.
|
|
|
|
*
|
|
|
|
* An empty input string, as a special case, results in an empty list
|
|
|
|
* (and not a list with an empty string).
|
|
|
|
*/
|
2020-04-03 16:42:49 +02:00
|
|
|
std::forward_list<std::string_view>
|
2020-04-03 16:38:55 +02:00
|
|
|
SplitString(std::string_view s, char separator, bool strip=true) noexcept;
|