format#

namespace heph#
namespace format#

Functions

template<typename T>
std::string toString(const T &data)#

Custom formatter for various data types using reflect-cpp.

Template Parameters:

T – The type of data to format.

Parameters:

data – The data to format.

Returns:

A formatted string representation of the data.

namespace rfl#
template<heph::ChronoClock Clock, heph::ChronoDurationType Duration>
struct Reflector<std::chrono::time_point<Clock, Duration>>#
#include “hephaestus/format/generic_formatter.h”

Specialization of the Reflector for chrono based Timestamp type. See getml/reflect-cpp For implementation of Reflector::to see commit b1a4eda Limitation: Reflect-cpp does not work on any type that has private members.

Public Types

using ReflType = std::string#

Public Static Functions

static inline ReflType from(const std::chrono::time_point<Clock, Duration> &x) noexcept#
template<heph::Formattable T>
struct Reflector<T>#
#include “hephaestus/format/generic_formatter.h”

Specialization of the Reflector for custom format that is defined as described by Formattable<T>.

Public Types

using ReflType = std::string#

Public Static Functions

static inline ReflType from(const T &x) noexcept#
namespace fmt#
template<typename T, typename Char>
struct formatter<T, Char> : public fmt::formatter<std::string_view, Char>#
#include “hephaestus/format/generic_formatter.h”

Generic fmt::formatter for all types that are not handled by fmt library. Note that we need to have the typename Char here in order to have the formatters in fmt/std.h be more specific than this one, to avoid collisions.

Public Functions

template<typename FormatContext>
inline auto format(const T &data, FormatContext &ctx) const#
namespace std#

Functions

template<typename T>
ostream &operator<<(ostream &os, const T &data)#

Generic operator<< for all types that are not handled by the standard. If you want or need to deactivate this for certain types, you can delete the operator explicitly // needs to be in the public std namespace to work namespace std { auto operator<<(ostream& os, const UncontrollableType&) -> ostream& = delete; } // namespace std

template<EnumType E>
struct formatter<E> : public fmt::formatter<std::string>#

Public Functions

template<typename FormatContext>
inline auto format(E value, FormatContext &ctx) const#