Expand version api and conversions

This commit is contained in:
Georg Hagen
2025-06-06 10:56:42 +02:00
parent 735a9afbf2
commit 0b019fa31e
5 changed files with 58 additions and 1 deletions

View File

@@ -25,6 +25,7 @@
#include "Math/Timestamp.hpp"
#include "Math/UInt24.hpp"
#include "Base/UUID.hpp"
#include "Base/Version.hpp"
#include <filesystem>
#include <fmt/chrono.h>
@@ -41,6 +42,19 @@ template<> struct fmt::formatter<OpenVulkano::ByteSize>
}
};
template<> struct fmt::formatter<OpenVulkano::Version>
{
template<typename ParseContext> constexpr auto parse(ParseContext& ctx)
{
return ctx.begin();
}
template<typename FormatContext> auto format(const OpenVulkano::Version& version, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "{}", static_cast<const std::string&>(version));
}
};
template<> struct fmt::formatter<std::filesystem::path> : fmt::formatter<std::string>
{
template<typename PATH = std::filesystem::path>