|
fmt
|
Formatting of built-in types: integers, floating point, strings and pointers, with the buffer and presentation-spec machinery behind them. More...
#include "fmt/macros.hpp"#include <cerrno>#include <climits>#include <limits.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <version>import fmt:base;import std;Namespaces | |
| namespace | fmt::literals |
Typedefs | |
| template<typename Char> | |
| using | fmt::detail::StdStringView = std::basic_string_view<Char> |
| using | fmt::detail::uint128_t = conditional_t<FMT_USE_INT128, NativeUint128, Uint128> |
| using | fmt::detail::uintptr_t = uint128_t |
| template<typename OutputIt> | |
| using | fmt::detail::ReserveIterator |
| template<typename T> | |
| using | fmt::detail::IsSigned |
| template<typename T> | |
| using | fmt::detail::IsInteger |
| template<typename T> | |
| using | fmt::detail::IsFloat128 = std::is_same<T, Float128> |
| using | fmt::MemoryBuffer = BasicMemoryBuffer<char> |
| template<typename T> | |
| using | fmt::detail::uint32_or_64_or_128_t |
| template<typename T> | |
| using | fmt::detail::uint64_or_128_t |
| using | fmt::detail::Fp = BasicFp<Ullong> |
| template<typename T, bool doublish = numBits<T>() == numBits<double>()> | |
| using | fmt::detail::ConvertFloatResult |
| template<typename T> | |
| using | fmt::detail::IsBuiltin |
| using | fmt::detail::FormatFunc = void (*)(detail::Buffer<char>&, int, const char*) |
Enumerations | |
| enum class | ToUtf8ErrorPolicy : int { kAbort = 0 , kReplace = 1 , kWtf = 2 } |
| enum class | Dragon : unsigned { kNone = 0 , kPredecessorCloser = 1 , kFixup = 2 , kFixed = 4 } |
Functions | |
|
template<typename To, typename From> requires (sizeof(To) == sizeof(From)) | |
| constexpr auto | fmt::detail::bitCast (const From &from) -> To |
| auto | fmt::detail::isBigEndian () -> bool |
| template<typename T> | |
| constexpr auto | fmt::detail::maxValue () -> T |
| template<typename T> | |
| constexpr auto | fmt::detail::numBits () -> int |
| template<> | |
| constexpr auto | fmt::detail::numBits< NativeInt128 > () -> int |
| template<> | |
| constexpr auto | fmt::detail::numBits< NativeUint128 > () -> int |
| template<> | |
| constexpr auto | fmt::detail::numBits< Uint128 > () -> int |
|
template<typename To, typename From> requires (sizeof(To) > sizeof(From)) | |
| auto | fmt::detail::bitCast (const From &from) -> To |
| constexpr auto | fmt::detail::countlZero (uint32_t n) -> int |
| constexpr auto | fmt::detail::countlZero (uint64_t n) -> int |
| auto | fmt::detail::assume (bool condition) -> void |
|
template<typename OutputIt> requires (IsBackInsertIterator<OutputIt>::value && IsContiguous<typename OutputIt::container>::value) | |
| constexpr auto | fmt::detail::reserve (OutputIt it, size_t n) -> typename OutputIt::value_type * |
| template<typename T> | |
| constexpr auto | fmt::detail::reserve (BasicAppender< T > it, size_t n) -> BasicAppender< T > |
| template<typename Iterator> | |
| constexpr auto | fmt::detail::reserve (Iterator &it, size_t) -> Iterator & |
| template<typename T, typename OutputIt> | |
| constexpr auto | fmt::detail::toPointer (OutputIt, size_t) -> T * |
| template<typename T> | |
| constexpr auto | fmt::detail::toPointer (T *&ptr, size_t n) -> T * |
| template<typename T> | |
| constexpr auto | fmt::detail::toPointer (BasicAppender< T > it, size_t n) -> T * |
|
template<typename OutputIt> requires (IsBackInsertIterator<OutputIt>::value && IsContiguous<typename OutputIt::container>::value) | |
| auto | fmt::detail::baseIterator (OutputIt it, typename OutputIt::container_type::value_type *) -> OutputIt |
| template<typename Iterator> | |
| constexpr auto | fmt::detail::baseIterator (Iterator, Iterator it) -> Iterator |
| template<typename OutputIt, typename Size, typename T> | |
| constexpr auto | fmt::detail::fill_n (OutputIt out, Size count, const T &value) -> OutputIt |
| template<typename T, typename Size> | |
| constexpr auto | fmt::detail::fill_n (T *out, Size count, char value) -> T * |
| template<typename T, typename V, typename OutputIt> | |
| constexpr auto | fmt::detail::copy (BasicStringView< V > s, OutputIt out) -> OutputIt |
| template<typename OutChar, typename InputIt, typename OutputIt> | |
| constexpr auto | fmt::detail::copyNoinline (InputIt begin, InputIt end, OutputIt out) -> OutputIt |
| constexpr auto | fmt::detail::utf8Decode (const char *s, uint32_t *c, int *e) -> const char * |
| template<typename F> | |
| constexpr auto | fmt::detail::forEachCodepoint (StringView s, F f) -> void |
| constexpr auto | fmt::detail::displayWidthOf (uint32_t cp) noexcept -> size_t |
| template<typename Formatter> | |
| constexpr auto | fmt::detail::maybeSetDebugFormat (Formatter &f, bool set) -> decltype(f.setDebugFormat(set)) |
| template<typename Formatter> | |
| constexpr auto | fmt::detail::maybeSetDebugFormat (Formatter &,...) -> void |
| template<size_t SIZE> | |
| auto | fmt::to_string (const BasicMemoryBuffer< char, SIZE > &buf) -> std::string |
| auto | fmt::detail::writeConsole (int fd, StringView text) -> bool |
| auto | fmt::detail::print (FILE *, StringView) -> void |
| template<typename Char, size_t N> | |
| constexpr auto | fmt::detail::compileStringToView (const Char(&s)[N]) -> BasicStringView< Char > |
| template<typename Char> | |
| constexpr auto | fmt::detail::compileStringToView (BasicStringView< Char > s) -> BasicStringView< Char > |
|
template<typename T> requires (IsSigned<T>::value) | |
| constexpr auto | fmt::detail::isNegative (T value) -> bool |
|
template<typename T> requires (!IsSigned<T>::value) | |
| constexpr auto | fmt::detail::isNegative (T) -> bool |
| auto | fmt::detail::digits2 (size_t value) noexcept -> const char * |
| auto | fmt::detail::digits2I (size_t value) noexcept -> const char * |
| template<typename Char> | |
| constexpr auto | fmt::detail::getsign (Sign s) -> Char |
| template<typename T> | |
| constexpr auto | fmt::detail::countDigitsFallback (T n) -> int |
| constexpr auto | fmt::detail::digitsInc (uint64_t n) -> uint64_t |
| auto | fmt::detail::doCountDigits (uint64_t n) -> int |
| constexpr auto | fmt::detail::countDigits (uint64_t n) -> int |
| template<int BITS, typename UInt> | |
| constexpr auto | fmt::detail::countDigits (UInt n) -> int |
| auto | fmt::detail::doCountDigits (uint32_t n) -> int |
| constexpr auto | fmt::detail::countDigits (uint32_t n) -> int |
| template<typename Int> | |
| constexpr auto | fmt::detail::digits10 () noexcept -> int |
| template<> | |
| constexpr auto | fmt::detail::digits10< NativeInt128 > () noexcept -> int |
| template<> | |
| constexpr auto | fmt::detail::digits10< uint128_t > () noexcept -> int |
| template<typename Char> | |
| auto | fmt::detail::thousandsSepImpl (LocaleRef loc) -> ThousandsSepResult< Char > |
| template<typename Char> | |
| auto | fmt::detail::thousandsSep (LocaleRef loc) -> ThousandsSepResult< Char > |
| template<> | |
| auto | fmt::detail::thousandsSep (LocaleRef loc) -> ThousandsSepResult< wchar_t > |
| template<typename Char> | |
| auto | fmt::detail::decimalPointImpl (LocaleRef loc) -> Char |
| template<typename Char> | |
| auto | fmt::detail::decimalPoint (LocaleRef loc) -> Char |
| template<> | |
| auto | fmt::detail::decimalPoint (LocaleRef loc) -> wchar_t |
| template auto | fmt::detail::thousandsSepImpl< char > (LocaleRef) -> ThousandsSepResult< char > |
| template auto | fmt::detail::thousandsSepImpl< wchar_t > (LocaleRef) -> ThousandsSepResult< wchar_t > |
| template auto | fmt::detail::decimalPointImpl (LocaleRef) -> char |
| template<typename Char> | |
| auto | fmt::detail::equal2 (const Char *lhs, const char *rhs) -> bool |
| auto | fmt::detail::equal2 (const char *lhs, const char *rhs) -> bool |
| template<typename Char> | |
| constexpr auto | fmt::detail::write2digits (Char *out, size_t value) -> void |
| template<typename Char> | |
| auto | fmt::detail::write2digitsI (Char *out, size_t value) -> void |
| template<typename Char, typename UInt> | |
| constexpr auto | fmt::detail::doFormatDecimal (Char *out, UInt value, int size) -> Char * |
| template<typename Char, typename UInt> | |
| constexpr auto | fmt::detail::formatDecimal (Char *out, UInt value, int num_digits) -> Char * |
|
template<typename Char, typename UInt, typename OutputIt> requires (!std::is_pointer<remove_cvref_t<OutputIt>>::value) | |
| constexpr auto | fmt::detail::formatDecimal (OutputIt out, UInt value, int num_digits) -> OutputIt |
| template<typename Char, typename UInt> | |
| constexpr auto | fmt::detail::doFormatBase2e (int base_bits, Char *out, UInt value, int size, bool upper=false) -> Char * |
| template<typename Char, typename UInt> | |
| constexpr auto | fmt::detail::formatBase2e (int base_bits, Char *out, UInt value, int num_digits, bool upper=false) -> Char * |
|
template<typename Char, typename OutputIt, typename UInt> requires (IsBackInsertIterator<OutputIt>::value) | |
| constexpr auto | fmt::detail::formatBase2e (int base_bits, OutputIt out, UInt value, int num_digits, bool upper=false) -> OutputIt |
| auto | fmt::detail::toUtf83bytes (Buffer< char > &buf, uint32_t cp) -> void |
| auto | fmt::detail::umul128 (uint64_t x, uint64_t y) noexcept -> Uint128 |
| auto | fmt::detail::dragonbox::floorLog10Pow2 (int e) noexcept -> int |
| auto | fmt::detail::dragonbox::floorLog2Pow10 (int e) noexcept -> int |
| auto | fmt::detail::dragonbox::umul128Upper64 (uint64_t x, uint64_t y) noexcept -> uint64_t |
| auto | fmt::detail::dragonbox::umul192Upper128 (uint64_t x, Uint128 y) noexcept -> Uint128 |
| auto | fmt::detail::dragonbox::getCachedPower (int k) noexcept -> Uint128 |
| template<typename T> | |
| auto | fmt::detail::dragonbox::toDecimal (T x) noexcept -> DecimalFp< T > |
| template<typename Float> | |
| constexpr auto | fmt::detail::hasImplicitBit () -> bool |
| template<typename Float> | |
| constexpr auto | fmt::detail::numSignificandBits () -> int |
| template<typename Float> | |
| constexpr auto | fmt::detail::exponentMask () -> typename dragonbox::FloatInfo< Float >::CarrierUint |
| template<typename Float> | |
| constexpr auto | fmt::detail::exponentBias () -> int |
| constexpr auto | fmt::detail::computeExpSize (int exp) -> int |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::writeExponent (int exp, OutputIt out) -> OutputIt |
| template<int SHIFT = 0, typename F> | |
| constexpr auto | fmt::detail::normalize (BasicFp< F > value) -> BasicFp< F > |
| constexpr auto | fmt::detail::multiply (uint64_t lhs, uint64_t rhs) -> uint64_t |
| constexpr auto | fmt::detail::operator* (Fp x, Fp y) -> Fp |
| template<typename T> | |
| constexpr auto | fmt::detail::convertFloat (T value) -> ConvertFloatResult< T > |
|
template<bool C, typename T, typename F> requires (C) | |
| auto | fmt::detail::select (T true_value, F) -> T |
|
template<bool C, typename T, typename F> requires (!C) | |
| auto | fmt::detail::select (T, F false_value) -> F |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::fill (OutputIt it, size_t n, const BasicSpecs &specs) -> OutputIt |
| template<typename Char, Align default_align = Align::kLeft, typename OutputIt, typename F> | |
| constexpr auto | fmt::detail::writePadded (OutputIt out, const FormatSpecs &specs, size_t size, size_t width, F &&f) -> OutputIt |
| template<typename Char, Align default_align = Align::kLeft, typename OutputIt, typename F> | |
| constexpr auto | fmt::detail::writePadded (OutputIt out, const FormatSpecs &specs, size_t size, F &&f) -> OutputIt |
| template<typename Char, Align default_align = Align::kLeft, typename OutputIt> | |
| constexpr auto | fmt::detail::writeBytes (OutputIt out, StringView bytes, const FormatSpecs &specs={}) -> OutputIt |
| template<typename Char, typename OutputIt, typename UIntPtr> | |
| auto | fmt::detail::writePtr (OutputIt out, UIntPtr value, const FormatSpecs *specs) -> OutputIt |
| auto | fmt::detail::isPrintable (uint32_t cp) -> bool |
| auto | fmt::detail::needsEscape (uint32_t cp) -> bool |
| template<typename Char> | |
| auto | fmt::detail::findEscape (const Char *begin, const Char *end) -> FindEscapeResult< Char > |
| auto | fmt::detail::findEscape (const char *begin, const char *end) -> FindEscapeResult< char > |
| template<size_t width, typename Char, typename OutputIt> | |
| auto | fmt::detail::writeCodepoint (OutputIt out, char prefix, uint32_t cp) -> OutputIt |
| template<typename OutputIt, typename Char> | |
| auto | fmt::detail::writeEscapedCp (OutputIt out, const FindEscapeResult< Char > &escape) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| auto | fmt::detail::writeEscapedString (OutputIt out, BasicStringView< Char > str) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| auto | fmt::detail::writeEscapedChar (OutputIt out, Char v) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::writeChar (OutputIt out, Char value, const FormatSpecs &specs) -> OutputIt |
| constexpr auto | fmt::detail::prefixAppend (unsigned &prefix, unsigned value) -> void |
| template<typename Char, typename OutputIt, typename UInt> | |
| constexpr auto | fmt::detail::writeIntChr (OutputIt out, UInt abs_value, bool negative, const FormatSpecs &specs) -> OutputIt |
| template<typename OutputIt, typename UInt, typename Char> | |
| auto | fmt::detail::writeInt (OutputIt out, UInt value, unsigned prefix, const FormatSpecs &specs, const DigitGrouping< Char > &grouping) -> OutputIt |
| template<typename OutputIt> | |
| auto | fmt::detail::writeLoc (OutputIt, const LocValue &, const FormatSpecs &, LocaleRef) -> bool |
| template<typename T> | |
| constexpr auto | fmt::detail::makeWriteIntArg (T value, Sign s) -> WriteIntArg< uint32_or_64_or_128_t< T > > |
| template<typename Char, typename OutputIt, typename T> | |
| constexpr auto | fmt::detail::writeInt (OutputIt out, WriteIntArg< T > arg, const FormatSpecs &specs) -> OutputIt |
| template<typename Char, typename OutputIt, typename T> | |
| constexpr auto | fmt::detail::writeIntNoinline (OutputIt out, WriteIntArg< T > arg, const FormatSpecs &specs) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (IsIntegral<T>::value && !std::is_same<T, bool>::value && !std::is_same<T, Char>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, T value, const FormatSpecs &specs, LocaleRef loc) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::write (OutputIt out, Char value, const FormatSpecs &specs, LocaleRef loc={}) -> OutputIt |
|
template<typename Char, typename OutputIt> requires (std::is_same<Char, char>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, BasicStringView< Char > s, const FormatSpecs &specs) -> OutputIt |
|
template<typename Char, typename OutputIt> requires (!std::is_same<Char, char>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, BasicStringView< Char > s, const FormatSpecs &specs) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::write (OutputIt out, BasicStringView< Char > s, const FormatSpecs &specs, LocaleRef) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::write (OutputIt out, const Char *s, const FormatSpecs &specs, LocaleRef) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (IsIntegral<T>::value && !std::is_same<T, bool>::value && !std::is_same<T, Char>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, T value) -> OutputIt |
| template<typename Char> | |
| constexpr auto | fmt::detail::parseAlign (const Char *begin, const Char *end, FormatSpecs &specs) -> const Char * |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::writeNonfinite (OutputIt out, bool isnan, FormatSpecs specs, Sign s) -> OutputIt |
| constexpr auto | fmt::detail::getSignificandSize (const BigDecimalFp &f) -> int |
| template<typename T> | |
| auto | fmt::detail::getSignificandSize (const dragonbox::DecimalFp< T > &f) -> int |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::writeSignificand (OutputIt out, const char *significand, int significand_size) -> OutputIt |
| template<typename Char, typename OutputIt, typename UInt> | |
| auto | fmt::detail::writeSignificand (OutputIt out, UInt significand, int significand_size) -> OutputIt |
| template<typename Char, typename OutputIt, typename T, typename Grouping> | |
| constexpr auto | fmt::detail::writeSignificand (OutputIt out, T significand, int significand_size, int exponent, const Grouping &grouping) -> OutputIt |
|
template<typename Char, typename UInt> requires (std::is_integral<UInt>::value) | |
| auto | fmt::detail::writeSignificand (Char *out, UInt significand, int significand_size, int integral_size, Char decimal_point) -> Char * |
|
template<typename OutputIt, typename UInt, typename Char> requires (!std::is_pointer<remove_cvref_t<OutputIt>>::value) | |
| auto | fmt::detail::writeSignificand (OutputIt out, UInt significand, int significand_size, int integral_size, Char decimal_point) -> OutputIt |
| template<typename OutputIt, typename Char> | |
| constexpr auto | fmt::detail::writeSignificand (OutputIt out, const char *significand, int significand_size, int integral_size, Char decimal_point) -> OutputIt |
| template<typename OutputIt, typename Char, typename T, typename Grouping> | |
| constexpr auto | fmt::detail::writeSignificand (OutputIt out, T significand, int significand_size, int integral_size, Char decimal_point, const Grouping &grouping) -> OutputIt |
| template<typename T> | |
| consteval auto | fmt::detail::expUpper () -> int |
| constexpr auto | fmt::detail::useFixed (int exp, int exp_upper) -> bool |
| template<typename Char, typename Grouping, typename OutputIt, typename DecimalFP> | |
| constexpr auto | fmt::detail::writeFixed (OutputIt out, const DecimalFP &f, int significand_size, Char decimal_point, const FormatSpecs &specs, Sign s, LocaleRef loc={}) -> OutputIt |
| template<typename Char, typename Grouping, typename OutputIt, typename DecimalFP> | |
| constexpr auto | fmt::detail::doWriteFloat (OutputIt out, const DecimalFP &f, const FormatSpecs &specs, Sign s, int exp_upper, LocaleRef loc) -> OutputIt |
| template<typename Char, typename OutputIt, typename DecimalFP> | |
| constexpr auto | fmt::detail::writeFloat (OutputIt out, const DecimalFP &f, const FormatSpecs &specs, Sign s, int exp_upper, LocaleRef loc) -> OutputIt |
| template<typename T> | |
| constexpr auto | fmt::detail::isnan (T value) -> bool |
|
template<typename T> requires (IsFloatingPoint<T>::value && HasIsfinite<T>::value) | |
| constexpr auto | fmt::detail::isfinite (T value) -> bool |
|
template<typename T> requires (!HasIsfinite<T>::value) | |
| constexpr auto | fmt::detail::isfinite (T value) -> bool |
|
template<typename T> requires (IsFloatingPoint<T>::value) | |
| constexpr auto | fmt::detail::signbit (T value) -> bool |
| constexpr auto | fmt::detail::adjustPrecision (int &precision, int exp10) -> void |
| constexpr auto | fmt::detail::operator| (Dragon lhs, Dragon rhs) -> Dragon |
| constexpr auto | fmt::detail::hasFlag (Dragon flags, Dragon flag) -> bool |
| constexpr auto | fmt::detail::formatDragon (BasicFp< uint128_t > value, Dragon flags, int num_digits, Buffer< char > &buf, int &exp10) -> void |
|
template<typename Float> requires (!IsDoubleDouble<Float>::value) | |
| constexpr auto | fmt::detail::formatHexfloat (Float value, FormatSpecs specs, Buffer< char > &buf) -> void |
|
template<typename Float> requires (IsDoubleDouble<Float>::value) | |
| constexpr auto | fmt::detail::formatHexfloat (Float value, FormatSpecs specs, Buffer< char > &buf) -> void |
| constexpr auto | fmt::detail::fractionalPartRoundingThresholds (int index) -> uint32_t |
| template<typename Float> | |
| constexpr auto | fmt::detail::formatFloat (Float value, int precision, const FormatSpecs &specs, bool binary32, Buffer< char > &buf) -> int |
|
template<typename Char, typename OutputIt, typename T> requires (IsFloatingPoint<T>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, T value, FormatSpecs specs, LocaleRef loc={}) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (IsFastFloat<T>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, T value) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (IsFloatingPoint<T>::value && !IsFastFloat<T>::value) | |
| auto | fmt::detail::write (OutputIt out, T value) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| auto | fmt::detail::write (OutputIt out, Monostate, FormatSpecs={}, LocaleRef={}) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::write (OutputIt out, BasicStringView< Char > value) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (HasToStringView<T>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, const T &value) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (std::is_enum<T>::value && !std::is_same<T, Char>::value && MappedTypeConstant<T, Char>::value != Type::kCustomType) | |
| constexpr auto | fmt::detail::write (OutputIt out, T value) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (std::is_same<T, bool>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, T value, const FormatSpecs &specs={}, LocaleRef={}) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::write (OutputIt out, Char value) -> OutputIt |
| template<typename Char, typename OutputIt> | |
| constexpr auto | fmt::detail::write (OutputIt out, const Char *value) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (std::is_same<T, void>::value) | |
| auto | fmt::detail::write (OutputIt out, const T *value, const FormatSpecs &specs={}, LocaleRef={}) -> OutputIt |
|
template<typename Char, typename OutputIt, typename T> requires (MappedTypeConstant<T, Char>::value == Type::kCustomType && !std::is_fundamental<T>::value) | |
| constexpr auto | fmt::detail::write (OutputIt out, const T &value) -> OutputIt |
| template<typename Context> | |
| constexpr auto | fmt::detail::handleDynamicSpec (ArgIdKind kind, int &value, const arg_ref< typename Context::char_type > &ref, Context &ctx) -> void |
| auto | fmt::detail::doReportError (FormatFunc func, int error_code, const char *message) noexcept -> void |
| auto | fmt::detail::formatErrorCode (Buffer< char > &out, int error_code, StringView message) noexcept -> void |
| fmt::FMT_FORMAT_AS (signed char, int) | |
| fmt::FMT_FORMAT_AS (unsigned char, unsigned) | |
| fmt::FMT_FORMAT_AS (short, int) | |
| fmt::FMT_FORMAT_AS (unsigned short, unsigned) | |
| fmt::FMT_FORMAT_AS (long, detail::LongType) | |
| fmt::FMT_FORMAT_AS (unsigned long, detail::UlongType) | |
| fmt::FMT_FORMAT_AS (Char *, const Char *) | |
| fmt::FMT_FORMAT_AS (detail::StdStringView< Char >, BasicStringView< Char >) | |
| fmt::FMT_FORMAT_AS (std::nullptr_t, const void *) | |
| fmt::FMT_FORMAT_AS (void *, const void *) | |
| template<typename T> | |
| auto | fmt::ptr (T p) -> const void * |
| template<typename Enum> | |
| constexpr auto | fmt::underlying (Enum e) noexcept -> underlying_t< Enum > |
| template<typename Enum> requires (std::is_enum<Enum>::value) | |
| constexpr auto | fmt::enums::formatAs (Enum e) noexcept -> underlying_t< Enum > |
| template<typename T> | |
| auto | fmt::groupDigits (T value) -> GroupDigitsView< T > |
| template<detail::FixedString S> | |
| constexpr auto | fmt::literals::operator""_a () |
| auto | fmt::vsystemError (int error_code, StringView fmt, FormatArgs args) -> std::system_error |
| template<typename... T> | |
| auto | fmt::systemError (int error_code, FormatString< T... > fmt, T &&... args) -> std::system_error |
| auto | fmt::formatSystemError (detail::Buffer< char > &out, int error_code, const char *message) noexcept -> void |
| auto | fmt::reportSystemError (int error_code, const char *message) noexcept -> void |
| auto | fmt::vformat (LocaleRef loc, StringView fmt, FormatArgs args) -> std::string |
| template<typename... T> | |
| auto | fmt::format (LocaleRef loc, FormatString< T... > fmt, T &&... args) -> std::string |
| template<typename OutputIt> requires (detail::IsOutputIterator<OutputIt, char>::value) | |
| auto | fmt::vformatTo (OutputIt out, LocaleRef loc, StringView fmt, FormatArgs args) -> OutputIt |
|
template<typename OutputIt, typename... T> requires (detail::IsOutputIterator<OutputIt, char>::value) | |
| auto | fmt::formatTo (OutputIt out, LocaleRef loc, FormatString< T... > fmt, T &&... args) -> OutputIt |
| template<typename... T> | |
| auto | fmt::formattedSize (LocaleRef loc, FormatString< T... > fmt, T &&... args) -> size_t |
| auto | fmt::vformat (StringView fmt, FormatArgs args) -> std::string |
| template<typename... T> | |
| auto | fmt::format (FormatString< T... > fmt, T &&... args) -> std::string |
| template<typename T> requires (std::is_integral<T>::value) | |
| constexpr auto | fmt::to_string (T value) -> std::string |
|
template<typename T> requires (detail::UseFormatAs<T>::value) | |
| constexpr auto | fmt::to_string (const T &value) -> std::string |
|
template<typename T> requires (!std::is_integral<T>::value && !detail::UseFormatAs<T>::value) | |
| constexpr auto | fmt::to_string (const T &value) -> std::string |
Variables | |
| constexpr uint32_t | fmt::detail::kInvalidCodePoint = ~uint32_t() |
| constexpr int | fmt::kInlineBufferSize = 500 |
Formatting of built-in types: integers, floating point, strings and pointers, with the buffer and presentation-spec machinery behind them.
Interface partition fmt:format.
| using fmt::detail::ConvertFloatResult |
| using fmt::detail::IsBuiltin |
| using fmt::detail::IsInteger |
| using fmt::detail::IsSigned |
|
export |
A growable char buffer with storage.
| using fmt::detail::ReserveIterator |
| using fmt::detail::uint32_or_64_or_128_t |
| using fmt::detail::uint64_or_128_t |
|
nodiscardexport |
Formats args according to specifications in fmt and returns the result as a string.
Example:
#include <fmt/format.hpp>
std::string message = fmt::format("The answer is {}.", 42);
|
export |
Formats args using the locale loc and returns the result as a string.
Only specifications with the L flag consult the locale; everything else is locale-independent.
| loc | the locale to use. |
| fmt | a format string, checked at compile time. |
| args | the arguments to format. |
Example:
auto s = fmt::format(std::locale("en_US.UTF-8"), "{:L}",
1234567);
|
constexprexportnoexcept |
Formats any enumeration as its underlying integer.
Opt in with using namespace fmt::enums; where the enumeration is used, or define a formatAs overload for a specific type instead.
|
exportnoexcept |
Formats an error message for an error returned by an operating system or a language runtime, for example a file opening error, and writes it to out. The format is the same as the one used by std::system_error(ec, message) where ec is std::error_code(error_code, std::generic_category()). It is implementation-defined but normally looks like:
<message>: <system-message>
where <message> is the passed message and <system-message> is the system message corresponding to the error code. error_code is a system error code as given by errno.
|
nodiscardexport |
Returns the number of characters format would produce, using loc.
| loc | the locale to use. |
| fmt | a format string, checked at compile time. |
| args | the arguments to format. |
|
export |
Returns a view that formats an integer value using ',' as a locale-independent thousands separator.
Example:
fmt::print("{}", fmt::groupDigits(12345));
// Output: "12,345"
|
export |
Converts p to const void* for pointer formatting.
Example:
auto s = fmt::format("{}", fmt::ptr(p));
|
exportnoexcept |
Reports a system error without throwing, for use in destructors.
| error_code | a system error code, as given by errno. |
| message | the message to prefix the system message with. |
|
export |
Constructs std::system_error with a message formatted with fmt::format(fmt, args...). error_code is a system error code as given by errno.
Example:
// This throws std::system_error with the description
// cannot open file 'madeup': No such file or directory
// or similar (system message may vary).
const char* filename = "madeup";
FILE* file = fopen(filename, "r");
if (!file)
throw fmt::systemError(errno, "cannot open file '{}'",
filename);
|
nodiscardexport |
Converts the contents of buf to a std::string.
| buf | the buffer to copy from. |
|
nodiscardconstexprexport |
Converts value to std::string using the default format for type T.
Example:
std::string answer = fmt::to_string(42);
|
constexprexportnoexcept |
Converts e to the underlying type.
Example:
enum class color { red, green, blue };
auto s = fmt::format("{}", fmt::underlying(color::red)); // s ==
"0"
|
export |
Type-erased form of the locale-aware format.
|
export |
Formats args using the locale loc and writes the result to out.
| out | an output iterator to write to. |
| loc | the locale to use. |
| fmt | a format string. |
| args | the type-erased arguments. |
|
constexprexport |
The default capacity of basic_memory_buffer, in elements.