Libmagicxx v10.0.3
A modern C++23 wrapper for libmagic — the library that powers the Unix file command.
Loading...
Searching...
No Matches
utility.hpp File Reference

Utility concepts, classes, and functions for the Magic library. More...

#include <algorithm>
#include <concepts>
#include <filesystem>
#include <functional>
#include <ranges>
#include <string>
Include dependency graph for utility.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Recognition
 Root namespace for the libmagicxx library.
namespace  Recognition::Utility
 Utility components for the libmagicxx library.

Concepts

concept  Recognition::Utility::RangeContainer
 Concept for types that are ranges with an accessible value_type.
concept  Recognition::Utility::StringConverter
 Concept for callables that convert a value to std::string.
concept  Recognition::Utility::FileContainer
 Concept for containers that can hold filesystem paths.

Functions

template<RangeContainer ContainerT, typename StringConverterT>
requires StringConverter<typename ContainerT::value_type, StringConverterT>
std::string Recognition::Utility::ToString (const ContainerT &container, const std::string &value_separator, StringConverterT string_converter)
 Convert a container to a string using a custom converter.
std::string Recognition::Utility::ToString (const FileContainer auto &container, const std::string &separator=", ")
 Convert a FileContainer to a string.

Detailed Description

Utility concepts, classes, and functions for the Magic library.

This file provides utility components used throughout the libmagicxx library:

  • Concepts for constraining template parameters
  • General-purpose string conversion functions
  • Progress tracking utilities