126template <
typename ContainerT>
128 &&
requires(ContainerT c) {
129 typename ContainerT::value_type;
158template <
typename ValueT,
typename StringConverterT>
160 std::invoke_result_t<StringConverterT, ValueT>,
190template <RangeContainer ContainerT,
typename StringConverterT>
193 const ContainerT& container,
194 const std::string& value_separator,
195 StringConverterT string_converter
198 if (container.empty()) {
201 return std::ranges::fold_left(
202 std::ranges::next(std::ranges::begin(container)),
203 std::ranges::end(container),
204 std::invoke(string_converter, *std::ranges::begin(container)),
205 [&](
const auto& left,
const auto& right) {
208 + std::invoke(string_converter, right);
249template <
typename ContainerT>
251 && std::default_initializable<ContainerT>
253 typename ContainerT::value_type,
254 std::filesystem::path
256 &&
requires(ContainerT c, std::filesystem::path p) {
259 typename ContainerT::value_type;
292 const std::string& separator =
", "
298 [](
const std::filesystem::path& path) {
299 return path.string();
Concept for containers that can hold filesystem paths.
Definition utility.hpp:250
Concept for types that are ranges with an accessible value_type.
Definition utility.hpp:127
Concept for callables that convert a value to std::string.
Definition utility.hpp:159
std::string ToString(const ContainerT &container, const std::string &value_separator, StringConverterT string_converter)
Convert a container to a string using a custom converter.
Definition utility.hpp:192
Utility components for the libmagicxx library.
Definition percentage.hpp:39
Root namespace for the libmagicxx library.