Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
format_juce.h
1// SPDX-FileCopyrightText: © 2024-2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <fmt/format.h>
7#include <juce_core/juce_core.h>
8
9// Formatter for juce::String
10template <>
11struct fmt::formatter<juce::String> : fmt::formatter<std::string_view>
12{
13 auto format (const juce::String &s, fmt::format_context &ctx) const
14 -> format_context::iterator
15 {
16 return fmt::formatter<std::string_view>::format (
17 std::string_view (s.toUTF8 ()), ctx);
18 }
19};
20static_assert (fmt::formattable<juce::String>);
21
22// Formatter for juce::File
23namespace juce
24{
25inline auto
26format_as (const File &file)
27{
28 return file.getFullPathName ();
29}
30}
31static_assert (fmt::formattable<juce::File>);