17 #include <type_traits> 21 #define FMT_VERSION 70003 24 # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) 26 # define FMT_CLANG_VERSION 0 29 #if defined(__GNUC__) && !defined(__clang__) 30 # define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) 32 # define FMT_GCC_VERSION 0 35 #if defined(__INTEL_COMPILER) 36 # define FMT_ICC_VERSION __INTEL_COMPILER 38 # define FMT_ICC_VERSION 0 41 #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) 42 # define FMT_HAS_GXX_CXX11 FMT_GCC_VERSION 44 # define FMT_HAS_GXX_CXX11 0 48 # define FMT_NVCC __NVCC__ 54 # define FMT_MSC_VER _MSC_VER 55 # define FMT_SUPPRESS_MSC_WARNING(n) __pragma(warning(suppress : n)) 57 # define FMT_MSC_VER 0 58 # define FMT_SUPPRESS_MSC_WARNING(n) 62 # define FMT_HAS_FEATURE(x) __has_feature(x) 64 # define FMT_HAS_FEATURE(x) 0 67 #if defined(__has_include) && !defined(__INTELLISENSE__) && \ 68 (!FMT_ICC_VERSION || FMT_ICC_VERSION >= 1600) 69 # define FMT_HAS_INCLUDE(x) __has_include(x) 71 # define FMT_HAS_INCLUDE(x) 0 74 #ifdef __has_cpp_attribute 75 # define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) 77 # define FMT_HAS_CPP_ATTRIBUTE(x) 0 80 #define FMT_HAS_CPP14_ATTRIBUTE(attribute) \ 81 (__cplusplus >= 201402L && FMT_HAS_CPP_ATTRIBUTE(attribute)) 83 #define FMT_HAS_CPP17_ATTRIBUTE(attribute) \ 84 (__cplusplus >= 201703L && FMT_HAS_CPP_ATTRIBUTE(attribute)) 88 #ifndef FMT_USE_CONSTEXPR 89 # define FMT_USE_CONSTEXPR \ 90 (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VER >= 1910 || \ 91 (FMT_GCC_VERSION >= 600 && __cplusplus >= 201402L)) && \ 92 !FMT_NVCC && !FMT_ICC_VERSION 95 # define FMT_CONSTEXPR constexpr 96 # define FMT_CONSTEXPR_DECL constexpr 98 # define FMT_CONSTEXPR inline 99 # define FMT_CONSTEXPR_DECL 103 # if FMT_HAS_FEATURE(cxx_override_control) || \ 104 (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 105 # define FMT_OVERRIDE override 107 # define FMT_OVERRIDE 112 #ifndef FMT_EXCEPTIONS 113 # if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \ 114 FMT_MSC_VER && !_HAS_EXCEPTIONS 115 # define FMT_EXCEPTIONS 0 117 # define FMT_EXCEPTIONS 1 122 #ifndef FMT_USE_NOEXCEPT 123 # define FMT_USE_NOEXCEPT 0 126 #if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \ 127 (FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || FMT_MSC_VER >= 1900 128 # define FMT_DETECTED_NOEXCEPT noexcept 129 # define FMT_HAS_CXX11_NOEXCEPT 1 131 # define FMT_DETECTED_NOEXCEPT throw() 132 # define FMT_HAS_CXX11_NOEXCEPT 0 136 # if FMT_EXCEPTIONS || FMT_HAS_CXX11_NOEXCEPT 137 # define FMT_NOEXCEPT FMT_DETECTED_NOEXCEPT 139 # define FMT_NOEXCEPT 145 #if FMT_EXCEPTIONS && FMT_HAS_CPP_ATTRIBUTE(noreturn) && !FMT_MSC_VER && \ 147 # define FMT_NORETURN [[noreturn]] 149 # define FMT_NORETURN 152 #ifndef FMT_DEPRECATED 153 # if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900 154 # define FMT_DEPRECATED [[deprecated]] 156 # if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__) 157 # define FMT_DEPRECATED __attribute__((deprecated)) 159 # define FMT_DEPRECATED __declspec(deprecated) 161 # define FMT_DEPRECATED 167 #if FMT_ICC_VERSION || defined(__PGI) || FMT_NVCC 168 # define FMT_DEPRECATED_ALIAS 170 # define FMT_DEPRECATED_ALIAS FMT_DEPRECATED 174 # if FMT_GCC_VERSION || FMT_CLANG_VERSION 175 # define FMT_INLINE inline __attribute__((always_inline)) 177 # define FMT_INLINE inline 181 #ifndef FMT_BEGIN_NAMESPACE 182 # if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ 183 (FMT_MSC_VER >= 1900 && !_MANAGED) 184 # define FMT_INLINE_NAMESPACE inline namespace 185 # define FMT_END_NAMESPACE \ 189 # define FMT_INLINE_NAMESPACE namespace 190 # define FMT_END_NAMESPACE \ 192 using namespace v7; \ 195 # define FMT_BEGIN_NAMESPACE \ 197 FMT_INLINE_NAMESPACE v7 { 200 #if !defined(FMT_HEADER_ONLY) && defined(_WIN32) 201 # define FMT_CLASS_API FMT_SUPPRESS_MSC_WARNING(4275) 203 # define FMT_API __declspec(dllexport) 204 # define FMT_EXTERN_TEMPLATE_API FMT_API 205 # define FMT_EXPORTED 206 # elif defined(FMT_SHARED) 207 # define FMT_API __declspec(dllimport) 208 # define FMT_EXTERN_TEMPLATE_API FMT_API 211 # define FMT_CLASS_API 216 #ifndef FMT_EXTERN_TEMPLATE_API 217 # define FMT_EXTERN_TEMPLATE_API 219 #ifndef FMT_INSTANTIATION_DEF_API 220 # define FMT_INSTANTIATION_DEF_API FMT_API 223 #ifndef FMT_HEADER_ONLY 224 # define FMT_EXTERN extern 230 #if (FMT_HAS_INCLUDE(<string_view>) && \ 231 (__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \ 232 (defined(_MSVC_LANG) && _MSVC_LANG > 201402L && _MSC_VER >= 1910) 233 # include <string_view> 234 # define FMT_USE_STRING_VIEW 235 #elif FMT_HAS_INCLUDE("experimental/string_view") && __cplusplus >= 201402L 236 # include <experimental/string_view> 237 # define FMT_USE_EXPERIMENTAL_STRING_VIEW 241 # define FMT_UNICODE !FMT_MSC_VER 243 #if FMT_UNICODE && FMT_MSC_VER 244 # pragma execution_character_set("utf-8") 250 template <
bool B,
class T =
void>
252 template <
bool B,
class T,
class F>
255 template <
typename T>
257 template <
typename T>
259 template <
typename T>
269 #define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0 277 const char* message);
282 # define FMT_ASSERT(condition, message) ((void)0) 284 # define FMT_ASSERT(condition, message) \ 287 : ::fmt::detail::assert_fail(__FILE__, __LINE__, (message))) 291 #if defined(FMT_USE_STRING_VIEW) 292 template <
typename Char>
using std_string_view = std::basic_string_view<Char>;
293 #elif defined(FMT_USE_EXPERIMENTAL_STRING_VIEW) 294 template <
typename Char>
295 using std_string_view = std::experimental::basic_string_view<Char>;
300 #ifdef FMT_USE_INT128 302 #elif defined(__SIZEOF_INT128__) && !FMT_NVCC && \ 303 !(FMT_CLANG_VERSION && FMT_MSC_VER) 304 # define FMT_USE_INT128 1 308 # define FMT_USE_INT128 0 316 template <
typename Int>
326 (
sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5);
336 #ifdef FMT_USE_INTERNAL 337 namespace internal =
detail;
369 #if __cplusplus >= 201703L // C++17's char_traits::length() is constexpr. 373 : data_(s), size_(
std::char_traits<Char>::length(s)) {}
376 template <
typename Traits,
typename Alloc>
378 const std::basic_string<Char, Traits, Alloc>& s)
FMT_NOEXCEPT 388 constexpr
const Char*
data()
const {
return data_; }
391 constexpr
size_t size()
const {
return size_; }
396 constexpr
const Char&
operator[](
size_t pos)
const {
return data_[pos]; }
405 size_t str_size = size_ < other.
size_ ? size_ : other.
size_;
406 int result = std::char_traits<Char>::compare(data_, other.
data_, str_size);
408 result = size_ == other.
size_ ? 0 : (size_ < other.
size_ ? -1 : 1);
436 template <
typename T>
struct is_char : std::false_type {};
437 template <>
struct is_char<char> : std::true_type {};
438 template <>
struct is_char<wchar_t> : std::true_type {};
440 template <>
struct is_char<char16_t> : std::true_type {};
441 template <>
struct is_char<char32_t> : std::true_type {};
464 template <
typename Char,
typename Traits,
typename Alloc>
466 const std::basic_string<Char, Traits, Alloc>& s) {
470 template <
typename Char>
475 template <
typename Char,
485 template <
typename S>
500 template <
typename S>
501 struct is_string : std::is_class<decltype(to_string_view(std::declval<S>()))> {
507 using type =
typename result::value_type;
513 #ifdef FMT_ENFORCE_COMPILE_STRING 515 "FMT_ENFORCE_COMPILE_STRING requires all format strings to use " 550 template <
typename Char,
typename ErrorHandler = detail::error_handler>
563 : ErrorHandler(eh), format_str_(format_str), next_arg_id_(next_arg_id) {}
588 if (next_arg_id_ >= 0)
return next_arg_id_++;
589 on_error(
"cannot switch from manual to automatic argument indexing");
598 if (next_arg_id_ > 0)
599 on_error(
"cannot switch from automatic to manual argument indexing");
607 ErrorHandler::on_error(message);
621 template <
typename T,
typename Char =
char,
typename Enable =
void>
629 template <
typename T,
typename Context>
631 std::is_constructible<typename Context::template formatter_type<T>>;
635 template <
typename Char>
641 template <
typename Container>
643 using bi_iterator = std::back_insert_iterator<Container>;
644 struct accessor : bi_iterator {
645 accessor(bi_iterator iter) : bi_iterator(iter) {}
646 using bi_iterator::container;
648 return *accessor(it).container;
678 capacity_ = buf_capacity;
682 virtual void grow(
size_t capacity) = 0;
689 void operator=(
const buffer&) =
delete;
716 size_ = count <= capacity_ ? count : capacity_;
724 if (new_capacity > capacity_) grow(new_capacity);
728 try_reserve(size_ + 1);
729 ptr_[size_++] =
value;
733 template <
typename U>
void append(
const U* begin,
const U* end);
735 template <
typename I> T&
operator[](I index) {
return ptr_[index]; }
744 size_t limit(
size_t size) {
return size; }
754 size_t count()
const {
return count_; }
756 size_t n = limit_ - count_;
758 return size < n ? size : n;
763 template <
typename OutputIt,
typename T,
typename Traits = buffer_traits>
767 enum { buffer_size = 256 };
768 T data_[buffer_size];
772 if (this->size() == buffer_size) flush();
779 buffer<T>(data_, 0, n < size_t(buffer_size) ? n : size_t(buffer_size)),
797 T*
out() {
return &*this->end(); }
801 template <
typename Container>
804 typename Container::value_type>> final
805 :
public buffer<typename Container::value_type> {
811 container_.resize(capacity);
812 this->
set(&container_[0], capacity);
820 std::back_insert_iterator<Container>
out() {
821 return std::back_inserter(container_);
828 enum { buffer_size = 256 };
829 T data_[buffer_size];
834 if (this->size() != buffer_size)
return;
835 count_ += this->size();
842 size_t count() {
return count_ + this->size(); }
847 template <
typename T>
849 using base = std::back_insert_iterator<buffer<T>>;
868 template <
typename T,
typename OutputIt>
879 template <
typename Buffer>
887 template <
typename T,
typename Char =
char,
typename Enable =
void>
893 template <
typename T,
typename Context>
895 std::is_constructible<fallback_formatter<T, typename Context::char_type>>;
902 named_arg(
const Char* n,
const T& v) : name(n), value(v) {}
910 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
914 T args_[1 + (NUM_ARGS != 0 ? NUM_ARGS : +1)];
917 template <
typename... U>
918 arg_data(
const U&... init) : args_{T(named_args_, NUM_NAMED_ARGS), init...} {}
920 const T*
args()
const {
return args_ + 1; }
924 template <
typename T,
typename Char,
size_t NUM_ARGS>
927 T args_[NUM_ARGS != 0 ? NUM_ARGS : +1];
929 template <
typename... U>
935 template <
typename Char>
938 template <
typename Char,
typename T,
typename... Tail>
940 int named_arg_count,
const T&,
const Tail&... args) {
944 template <
typename Char,
typename T,
typename... Tail>
947 const Tail&... args) {
948 named_args[named_arg_count++] = {arg.
name, arg_count};
952 template <
typename... Args>
957 template <
typename T,
typename Char>
960 template <
bool B = false> constexpr
size_t count() {
return B ? 1 : 0; }
961 template <
bool B1,
bool B2,
bool... Tail> constexpr
size_t count() {
962 return (B1 ? 1 : 0) +
count<B2, Tail...>();
993 template <
typename T,
typename Char>
996 #define FMT_TYPE_CONSTANT(Type, constant) \ 997 template <typename Char> \ 998 struct type_constant<Type, Char> \ 999 : std::integral_constant<type, type::constant> {} 1017 return t > type::none_type && t <= type::last_integer_type;
1021 return t > type::none_type && t <= type::last_numeric_type;
1041 template <
typename Context>
class value {
1076 string.data = val.
data();
1077 string.size = val.
size();
1081 : named_args{args, size} {}
1084 custom.value = &val;
1088 custom.format = format_custom_arg<
1090 typename Context::template formatter_type<T>,
1096 template <
typename T,
typename Formatter>
1098 typename Context::parse_context_type& parse_ctx,
1101 parse_ctx.advance_to(f.parse(parse_ctx));
1102 ctx.advance_to(f.format(*static_cast<const T*>(arg), ctx));
1106 template <
typename Context,
typename T>
1139 "mixing character types is disallowed");
1152 "mixing character types is disallowed");
1155 template <
typename T,
1175 return reinterpret_cast<const char*
>(val);
1179 return reinterpret_cast<const char*
>(val);
1182 const auto* const_val = val;
1183 return map(const_val);
1186 const auto* const_val = val;
1187 return map(const_val);
1198 static_assert(!
sizeof(T),
"formatting of non-void pointers is disallowed");
1202 template <
typename T,
1207 -> decltype(std::declval<arg_mapper>().map(
1211 template <
typename T,
1219 template <
typename T>
1221 -> decltype(std::declval<arg_mapper>().map(val.value)) {
1222 return map(val.value);
1229 template <
typename T,
typename Context>
1232 typename Context::char_type>;
1248 template <
typename ContextType,
typename T>
1252 template <
typename Visitor,
typename Ctx>
1255 -> decltype(vis(0));
1262 template <
typename T,
typename Char,
size_t NUM_ARGS,
size_t NUM_NAMED_ARGS>
1266 : value_(args, size) {}
1273 void format(
typename Context::parse_context_type& parse_ctx,
1274 Context& ctx)
const {
1275 custom_.format(custom_.value, parse_ctx, ctx);
1301 template <
typename Visitor,
typename Context>
1304 using char_type =
typename Context::char_type;
1305 switch (
arg.type_) {
1309 return vis(
arg.value_.int_value);
1311 return vis(
arg.value_.uint_value);
1313 return vis(
arg.value_.long_long_value);
1315 return vis(
arg.value_.ulong_long_value);
1318 return vis(
arg.value_.int128_value);
1320 return vis(
arg.value_.uint128_value);
1327 return vis(
arg.value_.bool_value);
1329 return vis(
arg.value_.char_value);
1331 return vis(
arg.value_.float_value);
1333 return vis(
arg.value_.double_value);
1335 return vis(
arg.value_.long_double_value);
1337 return vis(
arg.value_.string.data);
1340 arg.value_.string.size));
1342 return vis(
arg.value_.pointer);
1356 template <
typename... Ts>
1362 template <
typename It,
typename Enable =
void>
1366 using type = std::random_access_iterator_tag;
1369 template <
typename It>
1371 using type =
typename It::iterator_category;
1381 template <
typename U>
1382 static decltype(*(std::declval<U>())) test(std::input_iterator_tag);
1383 template <typename U> static
char& test(std::output_iterator_tag);
1384 template <typename U> static const
char& test(...);
1389 enum { value = !std::is_const<remove_reference_t<type>>
::value };
1392 template <
typename OutputIt>
1394 template <
typename Container>
1396 : std::true_type {};
1398 template <
typename OutputIt>
1400 template <
typename Container>
1403 template <
typename Char>
1405 : std::true_type {};
1414 template <
typename Locale>
explicit locale_ref(
const Locale& loc);
1418 template <
typename Locale> Locale
get()
const;
1421 template <
typename> constexpr
unsigned long long encode_types() {
return 0; }
1423 template <
typename Context,
typename Arg,
typename... Args>
1429 template <
typename Context,
typename T>
1440 "Cannot format an argument. To make type T formattable provide a " 1441 "formatter<T> specialization: https://fmt.dev/dev/api.html#udt");
1444 template <
typename T,
typename U>
inline const U&
check(
const U& val) {
1451 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1457 template <
bool IS_PACKED,
typename Context,
type,
typename T,
1460 return make_arg<Context>(
value);
1464 template <
typename T>
1467 template <
typename T>
const T&
unwrap(
const T& v) {
return v; }
1468 template <
typename T>
const T&
unwrap(
const std::reference_wrapper<T>& v) {
1469 return static_cast<const T&
>(v);
1476 template <
typename =
void>
struct node {
1477 virtual ~
node() =
default;
1484 template <
typename Arg>
1487 template <
typename Char>
1489 : value(arg.
data(), arg.size()) {}
1495 template <
typename T,
typename Arg>
const T&
push(
const Arg&
arg) {
1497 auto& value = new_node->value;
1531 : out_(out), args_(ctx_args), loc_(loc) {}
1539 void on_error(
const char* message) { error_handler().on_error(message); }
1552 template <
typename Char>
1559 #define FMT_BUFFER_CONTEXT(Char) \ 1560 basic_format_context<detail::buffer_appender<Char>, Char> 1569 template <
typename Context,
typename... Args>
1590 static constexpr
unsigned long long desc =
1593 (num_named_args != 0
1620 const Args&... args) {
1632 template <
typename... Args,
typename S,
typename Char =
char_t<S>>
1640 "passing views as lvalues is disallowed");
1655 template <
typename Char,
typename T>
1671 template <
typename Context>
1673 #if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
1687 std::is_same<T, basic_string_view<char_type>>
::value ||
1688 std::is_same<T, detail::std_string_view<char_type>>
::value ||
1695 template <
typename T>
1697 std::basic_string<char_type>, T>;
1700 std::vector<basic_format_arg<Context>>
data_;
1711 (named_info_.empty()
1717 return named_info_.empty() ? data_.data() : data_.data() + 1;
1721 data_.emplace_back(detail::make_arg<Context>(arg));
1724 template <
typename T>
1726 if (named_info_.empty()) {
1728 data_.insert(data_.begin(), {zero_ptr, 0});
1731 auto pop_one = [](std::vector<basic_format_arg<Context>>*
data) {
1734 std::unique_ptr<std::vector<basic_format_arg<Context>>, decltype(pop_one)>
1735 guard{&data_, pop_one};
1736 named_info_.push_back({arg.
name,
static_cast<int>(data_.size() - 2u)});
1737 data_[0].value_.named_args = {named_info_.data(), named_info_.size()};
1792 "objects of built-in types and string views are always copied");
1793 emplace_arg(arg.get());
1801 template <
typename T>
1804 dynamic_args_.
push<std::basic_string<char_type>>(arg.
name).c_str();
1816 named_info_.clear();
1826 void reserve(
size_t new_cap,
size_t new_cap_named) {
1828 "Set of arguments includes set of named arguments");
1829 data_.reserve(new_cap);
1830 named_info_.reserve(new_cap_named);
1873 return static_cast<detail::type>((desc_ >> shift) & mask);
1878 : desc_(desc), values_(values) {}
1880 : desc_(desc), args_(args) {}
1890 template <
typename... Args>
1892 : basic_format_args(store.desc, store.data_.args()) {}
1901 : basic_format_args(store.get_types(), store.
data()) {}
1916 if (
id < max_size()) arg = args_[
id];
1922 arg.
value_ = values_[id];
1927 int id = get_id(
name);
1932 if (!has_named_args())
return -1;
1933 const auto& named_args =
1934 (is_packed() ? values_[-1] : args_[-1].value_).named_args;
1935 for (
size_t i = 0; i < named_args.size; ++i) {
1936 if (named_args.data[i].name == name)
return named_args.data[i].id;
1943 return static_cast<int>(is_packed() ? max_packed
1951 template <
typename... Args>
1961 std::basic_string<Char>
vformat(
1967 template <
typename Char>
1972 template <
typename Char,
typename Args,
1985 template <
typename OutputIt,
typename S,
typename Char =
char_t<S>,
1986 FMT_ENABLE_IF(detail::is_output_iterator<OutputIt>::value)>
1988 OutputIt out,
const S& format_str,
2006 template <
typename OutputIt,
typename S,
typename... Args,
2009 inline OutputIt
format_to(OutputIt out,
const S& format_str, Args&&... args) {
2021 template <
typename OutputIt,
typename Char,
typename... Args,
2039 template <
typename OutputIt,
typename S,
typename... Args,
2043 const S& format_str,
2044 const Args&... args) {
2053 template <
typename... Args>
2061 template <
typename S,
typename Char =
char_t<S>>
2063 const S& format_str,
2080 template <
typename S,
typename... Args,
typename Char =
char_t<S>>
2100 template <
typename S,
typename... Args,
typename Char =
char_t<S>>
2101 inline void print(std::FILE* f,
const S& format_str, Args&&... args) {
2103 return detail::is_unicode<Char>()
2119 template <
typename S,
typename... Args,
typename Char =
char_t<S>>
2120 inline void print(
const S& format_str, Args&&... args) {
2122 return detail::is_unicode<Char>()
2129 #endif // FMT_CORE_H_
FMT_INLINE value(const void *val)
constexpr FMT_INLINE value(int val=0)
#define FMT_ENABLE_IF(...)
fixed_buffer_traits(size_t limit)
buffer_appender(buffer< T > &buf)
FMT_CONSTEXPR unsigned long long map(unsigned long long val)
FMT_INLINE value(char_type val)
buffer_appender operator++(int)
constexpr bool is_arithmetic_type(type t)
FMT_CONSTEXPR auto map(const T &val) -> decltype(std::declval< arg_mapper >().map(static_cast< typename std::underlying_type< T >::type >(val)))
enum MQTTPropertyCodes value
constexpr const Char * data() const
void init_named_args(named_arg_info< Char > *, int, int)
FMT_CONSTEXPR basic_string_view(const std::basic_string< Char, Traits, Alloc > &s) FMT_NOEXCEPT
static void format_custom_arg(const void *arg, typename Context::parse_context_type &parse_ctx, Context &ctx)
std::unique_ptr< node<> > head_
typename basic_format_context::char_type char_type
buffer_appender & operator++()
FMT_INLINE const T * args() const
typename detail::char_t_impl< S >::type char_t
iterator_buffer(T *out, size_t=0)
const T & push(const Arg &arg)
FMT_INLINE std::basic_string< Char > format(const S &format_str, Args &&...args)
basic_format_context(OutputIt out, basic_format_args< basic_format_context > ctx_args, detail::locale_ref loc=detail::locale_ref())
FMT_CONSTEXPR typed_node(const Arg &arg)
auto make_args_checked(const S &format_str, const remove_reference_t< Args > &...args) -> format_arg_store< buffer_context< Char >, remove_reference_t< Args >... >
typename result::value_type type
FMT_CONSTEXPR void advance_to(iterator it)
void try_reserve(size_t new_capacity)
typename std::conditional< B, T, F >::type conditional_t
const T * end() const FMT_NOEXCEPT
std::random_access_iterator_tag type
iterator_buffer(std::back_insert_iterator< Container > out, size_t=0)
FMT_CONSTEXPR const void * map(std::nullptr_t val)
FMT_CONSTEXPR int128_t map(int128_t val)
buffer_appender< T > get_iterator(buffer< T > &buf)
named_arg_info< Char > * named_args()
void try_resize(size_t count)
constexpr T const_check(T value)
constexpr iterator end() const FMT_NOEXCEPT
FMT_CONSTEXPR const char_type * map(char_type *val)
basic_string_view< Char > to_string_view(const Char *s)
void grow(size_t) final FMT_OVERRIDE
detail::locale_ref locale()
size_t size() const FMT_NOEXCEPT
FMT_INLINE value(long long val)
FMT_CONSTEXPR ulong_type map(unsigned long val)
#define FMT_CONSTEXPR_DECL
FMT_CONSTEXPR basic_format_arg< Context > make_arg(const T &value)
int arg_id(basic_string_view< char_type > name)
FMT_CONSTEXPR int map(const T *)
friend bool operator<(basic_string_view lhs, basic_string_view rhs)
FMT_CONSTEXPR float map(float val)
decltype(to_string_view(std::declval< S >())) result
typename std::remove_cv< remove_reference_t< T >>::type remove_cvref_t
OutputIt vformat_to(OutputIt out, const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
FMT_CONSTEXPR const void * map(void *val)
FMT_CONSTEXPR int map(int val)
FMT_CONSTEXPR const void * map(const void *val)
FMT_INLINE void init_named_args(std::nullptr_t, int, int, const Args &...)
constexpr FMT_INLINE value(unsigned val)
void vprint_mojibake(std::FILE *, basic_string_view< Char >, const Args &)
FMT_CONSTEXPR unsigned map(unsigned val)
FMT_INLINE value(basic_string_view< char_type > val)
FMT_CONSTEXPR const char * map(unsigned char *val)
OutputIt get_buffer_init(OutputIt out)
FMT_CONSTEXPR void on_error(const char *message)
constexpr unsigned long long encode_types()
const T * data() const FMT_NOEXCEPT
FMT_INLINE value(unsigned long long val)
#define FMT_END_NAMESPACE
typename It::iterator_category type
FMT_CONSTEXPR unsigned map(unsigned char val)
buffer_context< char > format_context
buffer< T > & get_buffer_init(buffer_appender< T > out)
FMT_CONSTEXPR bool map(bool val)
FMT_INLINE std::basic_string< Char > vformat(const S &format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
FMT_INLINE value(int128_t val)
FMT_INLINE arg_data(const U &...init)
FMT_API void vprint_mojibake(std::FILE *, string_view, format_args)
friend bool operator!=(basic_string_view lhs, basic_string_view rhs)
long double long_double_value
FMT_CONSTEXPR std::make_unsigned< Int >::type to_unsigned(Int value)
buffer< T > & get_buffer(buffer_appender< T >)
basic_string_view(const Char *s)
conditional_t< long_short, unsigned, unsigned long long > ulong_type
void grow(size_t) final FMT_OVERRIDE
buffer_appender< Char > vformat_to(buffer< Char > &buf, basic_string_view< Char > format_str, basic_format_args< FMT_BUFFER_CONTEXT(type_identity_t< Char >)> args)
FMT_CONSTEXPR_DECL FMT_INLINE auto visit_format_arg(Visitor &&vis, const basic_format_arg< Context > &arg) -> decltype(vis(0))
void push_back(const T &value)
constexpr bool is_integral_type(type t)
friend bool operator>=(basic_string_view lhs, basic_string_view rhs)
void print(std::FILE *f, const S &format_str, Args &&...args)
FMT_INLINE value(const T &val)
FMT_CONSTEXPR char_type map(T val)
decltype(test< It >(typename iterator_category< It >::type{})) type
constexpr iterator begin() const FMT_NOEXCEPT
FMT_CONSTEXPR long_type map(long val)
FMT_CONSTEXPR auto map(const named_arg< char_type, T > &val) -> decltype(std::declval< arg_mapper >().map(val.value))
std::back_insert_iterator< buffer< T >> base
std::basic_string< Char > vformat(basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
FMT_CONSTEXPR const T & map(const T &val)
void grow(size_t capacity) final FMT_OVERRIDE
typename detail::void_t_impl< Ts... >::type void_t
typename std::remove_reference< T >::type remove_reference_t
long long long_long_value
FMT_CONSTEXPR typed_node(const basic_string_view< Char > &arg)
format_arg arg(int id) const
friend bool operator>(basic_string_view lhs, basic_string_view rhs)
FMT_CONSTEXPR int next_arg_id()
#define FMT_BUFFER_CONTEXT(Char)
FMT_INLINE value(double val)
typename basic_format_context::parse_context_type parse_context
#define FMT_TYPE_CONSTANT(Type, constant)
custom_value< Context > custom
FMT_CONSTEXPR long long map(long long val)
FMT_CONSTEXPR double map(double val)
FMT_INLINE value(bool val)
FMT_INLINE std::nullptr_t named_args()
const T * begin() const FMT_NOEXCEPT
constexpr basic_string_view(const Char *s, size_t count) FMT_NOEXCEPT
typename Context::char_type char_type
FMT_CONSTEXPR void check_arg_id(basic_string_view< Char >)
format_arg_store< Context, Args... > make_format_args(const Args &...args)
const T & unwrap(const std::reference_wrapper< T > &v)
constexpr const Char & operator[](size_t pos) const
void advance_to(iterator it)
size_t limit(size_t size)
auto get_iterator(Buffer &buf) -> decltype(buf.out())
constexpr size_t size() const
static void check(LexState *ls, int c)
friend bool operator<=(basic_string_view lhs, basic_string_view rhs)
detail::named_arg< Char, T > arg(const Char *name, const T &arg)
unsigned long long ulong_long_value
const T & operator[](I index) const
OutputIt format_to(OutputIt out, const S &format_str, Args &&...args)
const T & move(const T &v)
buffer(T *p=nullptr, size_t sz=0, size_t cap=0) FMT_NOEXCEPT
FMT_CONSTEXPR const char_type * map(const char_type *val)
named_arg(const Char *n, const T &v)
iterator_buffer(OutputIt out, size_t n=buffer_size)
const basic_format_args< basic_format_context > & args() const
FMT_CONSTEXPR uint128_t map(uint128_t val)
typename std::remove_const< T >::type remove_const_t
void on_error(const char *message)
FMT_INLINE value(uint128_t val)
std::is_constructible< typename Context::template formatter_type< T >> has_formatter
Container & get_container(std::back_insert_iterator< Container > it)
std::back_insert_iterator< Container > out()
std::is_constructible< fallback_formatter< T, typename Context::char_type >> has_fallback_formatter
constexpr size_t count_named_args()
#define FMT_SUPPRESS_MSC_WARNING(n)
std::unique_ptr< node<> > next
string_value< char_type > string
FMT_INLINE void check_format_string(const S &)
constexpr unsigned long long encode_types()
const named_arg_info< Char > * data
typename basic_string_view< Char >::iterator iterator
friend bool operator==(basic_string_view lhs, basic_string_view rhs)
constexpr iterator end() const
typename type_identity< T >::type type_identity_t
iterator_buffer(Container &c)
FMT_CONSTEXPR long double map(long double val)
FMT_CONSTEXPR const char * map(const unsigned char *val)
basic_format_args< basic_format_context > args_
size_t formatted_size(string_view format_str, Args &&...args)
FMT_CONSTEXPR basic_string_view< char_type > map(const T &val)
basic_format_arg< Context > make_arg(const T &value)
named_arg_value< char_type > named_args
FMT_CONSTEXPR const char * map(signed char *val)
FMT_INLINE value(float val)
constexpr iterator begin() const
FMT_INLINE value(long double val)
int compare(basic_string_view other) const
typename std::enable_if< B, T >::type enable_if_t
FMT_CONSTEXPR int map(signed char val)
detail::error_handler error_handler()
void clear(lua_State *L, int table_index)
FMT_CONSTEXPR basic_string_view(S s) FMT_NOEXCEPT
conditional_t< long_short, int, long long > long_type
basic_string_view< Char > format_str_
#define FMT_ASSERT(condition, message)
FMT_API void vprint(string_view, format_args)
#define FMT_BEGIN_NAMESPACE
const T & unwrap(const T &v)
FMT_CONSTEXPR int map(short val)
const wchar_t & const_reference
void grow(size_t) final FMT_OVERRIDE
FMT_INLINE value(const named_arg_info< char_type > *args, size_t size)
arg_data(const U &...init)
constexpr basic_string_view() FMT_NOEXCEPT
size_t limit(size_t size)
constexpr ErrorHandler error_handler() const
FMT_CONSTEXPR void check_arg_id(int)
FMT_CONSTEXPR unsigned map(unsigned short val)
constexpr bool is_unicode()
FMT_CONSTEXPR const char * map(const signed char *val)
FMT_CONSTEXPR void remove_prefix(size_t n)
void check_format_string(S)
FMT_INLINE value(const char_type *val)
std::integral_constant< bool, B > bool_constant
format_to_n_result< OutputIt > format_to_n(OutputIt out, size_t n, const S &format_str, const Args &...args)
constexpr basic_format_parse_context(basic_string_view< Char > format_str, ErrorHandler eh={}, int next_arg_id=0)
format_arg arg(basic_string_view< char_type > name)
FMT_NORETURN FMT_API void assert_fail(const char *file, int line, const char *message)
format_to_n_result< OutputIt > vformat_to_n(OutputIt out, size_t n, basic_string_view< Char > format_str, basic_format_args< buffer_context< type_identity_t< Char >>> args)
size_t capacity() const FMT_NOEXCEPT