26#ifndef GUL17_JOIN_SPLIT_H_
27#define GUL17_JOIN_SPLIT_H_
124template <
typename StringContainer = std::vector<std::
string>,
125 typename ContainerInsertFct =
void (*)(StringContainer&, std::
string_view)>
130 using StringType =
typename StringContainer::value_type;
131 using SizeType =
typename StringType::size_type;
139 if (
hit == StringType::npos)
175template <
typename StringContainer = std::vector<std::
string>,
176 typename ContainerInsertFct =
void (*)(StringContainer&, std::
string_view)>
181 auto const end = std::cregex_iterator{ };
191 auto previous = std::cregex_iterator{ };
229template <
typename StringContainer = std::vector<std::
string_view>,
230 typename ContainerInsertFct =
void (*)(StringContainer&, std::
string_view)>
241template <
typename,
typename =
void>
242struct HasSize : std::false_type
246struct HasSize<
T, std::
void_t<decltype(std::declval<const T&>().size())>> : std::true_type
285template <
typename Iterator>
287join(Iterator begin, Iterator end, std::string_view
glue)
295 if constexpr (detail::HasSize<ElementType>::value)
300 for (
auto it = begin;
it != end; ++
it)
313 for (
auto it = std::next(begin);
it != end; ++
it)
361template <
typename StringContainer>
400template <
typename Iterator,
typename ConversionFct>
405 static_assert(std::is_invocable_v<
ConversionFct,
decltype(*begin)>,
406 "ConversionFct does not accept the element type of the range");
417 for (
auto it = std::next(begin);
it != end; ++
it)
456template <
typename Container,
typename ConversionFct>
auto constexpr bit_set(unsigned bit) noexcept -> ReturnT
Set a bit in an integral type.
Definition bit_manip.h:124
StringContainer split_sv(std::string_view text, std::string_view delimiter, ContainerInsertFct insert_fct=detail::emplace_back< StringContainer >)
Separate a string at all occurrences of a delimiter, returning the strings between the delimiters in ...
Definition join_split.h:232
std::string join(Iterator begin, Iterator end, std::string_view glue)
Concatenate all strings (or string-like elements) in a range, placing a delimiter between them.
Definition join_split.h:287
StringContainer split(std::string_view text, std::string_view delimiter, ContainerInsertFct insert_fct=detail::emplace_back< StringContainer >)
Separate a string at all occurrences of a delimiter, returning the strings between the delimiters in ...
Definition join_split.h:127
Definition of macros used internally by GUL.
Namespace gul17 contains all functions and classes of the General Utility Library.
Definition doxygen.h:29
Declaration of string utility functions.