gsvector_formatter.h (585B)
1 // SPDX-FileCopyrightText: 2024 Connor McLaughlin <stenzek@gmail.com> 2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) 3 4 #pragma once 5 6 #include "gsvector.h" 7 #include "small_string.h" 8 9 #include "fmt/format.h" 10 11 template<> 12 struct fmt::formatter<GSVector4i> : formatter<std::string_view> 13 { 14 auto format(const GSVector4i& rc, format_context& ctx) const 15 { 16 const TinyString str = 17 TinyString::from_format("{},{} => {},{} ({}x{})", rc.left, rc.top, rc.right, rc.bottom, rc.width(), rc.height()); 18 19 return fmt::formatter<std::string_view>::format(str.view(), ctx); 20 } 21 };