/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #if __has_include("fmt/format.h") #include #elif __has_include("spdlog/fmt/fmt.h") #include #else #error "Failed to find fmt include" #endif #include "Math/ByteSize.hpp" #include template<> struct fmt::formatter { template constexpr auto parse(ParseContext& ctx) { return ctx.begin(); } template auto format(const OpenVulkano::ByteSize& bs, FormatContext& ctx) const { return fmt::format_to(ctx.out(), "{}", bs.Format()); } }; template<> struct fmt::formatter : fmt::formatter { template auto format(const std::filesystem::path& path, format_context& ctx) const requires std::is_same_v { return formatter::format(path.native(), ctx); } template auto format(const std::filesystem::path& path, format_context& ctx) const requires std::is_same_v { return formatter::format(path.string(), ctx); } };