Namespaces
Enumerations
enum class PrintfNewline : _Bool
| Name | Value |
|---|---|
| kNo | 0 |
| kYes | 1 |
This provides a handy generic wrapper for using the printf core with an
arbitrary int(std::string_view) callable object.
Defined at line 18 of file ../../sdk/lib/c/stdio/printf_core/wrapper.h
enum class OverflowMode
| Name | Value | Comments |
|---|---|---|
| DROP_OVERFLOW | 0 |
===-- printf write mode definitions ----------------------------*- C++ -*-===//
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
===----------------------------------------------------------------------===// |
| CALLBACK | 1 |
===-- printf write mode definitions ----------------------------*- C++ -*-===//
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
===----------------------------------------------------------------------===// |
Defined at line 25 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
enum class LengthModifier
| Name | Value |
|---|---|
| hh | 0 |
| h | 1 |
| l | 2 |
| ll | 3 |
| j | 4 |
| z | 5 |
| t | 6 |
| L | 7 |
| w | 8 |
| wf | 9 |
| none | 10 |
These length modifiers match the length modifiers in the format string, which
is why they are formatted differently from the rest of the file.
Defined at line 44 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
enum FormatFlags : uint8_t
| Name | Value | Comments |
|---|---|---|
| LEFT_JUSTIFIED | 0x01 |
- |
| FORCE_SIGN | 0x02 |
+ |
| SPACE_PREFIX | 0x04 |
space |
| ALTERNATE_FORM | 0x08 |
# |
| LEADING_ZEROES | 0x10 |
0 |
Defined at line 74 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
enum class RoundDirection
| Name | Value |
|---|---|
| Up | 0 |
| Down | 1 |
| Even | 2 |
This is used to represent which direction the number should be rounded.
Defined at line 76 of file ../../third_party/llvm-libc/src/src/__support/printf_core/converter_utils.h
enum PrimaryType : uint8_t
| Name | Value |
|---|---|
| Unknown | 0 |
| Float | 1 |
| Pointer | 2 |
| Integer | 3 |
| FixedPoint | 4 |
Defined at line 134 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
Records
-
class BasicFormatSection -
class CharConstant -
class CharConstant<char, ascii_value> -
class CharConstant<wchar_t, ascii_value> -
class FloatHexExpFPBitsProperties -
class FloatWriter -
class InfNanFPBitsProperties -
class LengthSpec -
class Mode -
class OverflowWriter -
class OverflowWriter<OverflowMode::DROP_OVERFLOW, CharT> -
class OverflowWriter<OverflowMode::CALLBACK, CharT> -
class PaddingWriter -
class Parser -
class TypeDesc -
class WriteBuffer -
class Writer -
class int_type_of -
class int_type_of<T, cpp::enable_if_t<cpp::is_same_v<T, double> #if !defined(LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE) || cpp::is_same_v<T, long double> #endif // LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE #if defined(LIBC_TYPES_HAS_NATIVE_FLOAT128) || cpp::is_same_v<T, float128> #endif // LIBC_TYPES_HAS_NATIVE_FLOAT128 >> -
class int_type_of<T, cpp::enable_if_t<cpp::is_same_v<T, double> #if !defined(LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE) || cpp::is_same_v<T, long double> #endif // LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE #if defined(LIBC_TYPES_HAS_NATIVE_FLOAT128) || cpp::is_same_v<T, float128> #endif // LIBC_TYPES_HAS_NATIVE_FLOAT128 >>
Functions
-
template <OverflowMode mode>FloatWriter<mode> <deduction guide for FloatWriter> (Writer<mode>,bool,const PaddingWriter<mode>)Class-template auto deduction helpers, add more if needed.
-
template <OverflowMode mode>int convert_pointer (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 22 of file ../../third_party/llvm-libc/src/src/__support/printf_core/ptr_converter.h
-
uintmax_t apply_length_modifier (uintmax_t num, LengthSpec length_spec)Defined at line 22 of file ../../third_party/llvm-libc/src/src/__support/printf_core/converter_utils.h
-
uintmax_t apply_length_modifier (uintmax_t num, LengthSpec length_spec)Defined at line 22 of file ../../third_party/llvm-libc/src/src/__support/printf_core/converter_utils.h
-
template <OverflowMode mode>int convert_strerror (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 23 of file ../../third_party/llvm-libc/src/src/__support/printf_core/strerror_converter.h
-
template <size_t BufferSize,PrintfNewline AddNewline = PrintfNewline::kNo,typename T>int Printf (T &&write,const char *format,va_listargs)Defined at line 24 of file ../../sdk/lib/c/stdio/printf_core/wrapper.h
-
template <size_t BufferSize,PrintfNewline AddNewline = PrintfNewline::kNo,typename T>int Printf (T &&write,const char *format,va_listargs)Defined at line 24 of file ../../sdk/lib/c/stdio/printf_core/wrapper.h
-
template <OverflowMode mode>ErrorOr<size_t> printf_main_modular (Writer<mode> *writer,const char *__restrictstr,internal::ArgList &args)Defined at line 26 of file ../../third_party/llvm-libc/src/src/__support/printf_core/printf_main.h
-
template <OverflowMode mode>ErrorOr<size_t> printf_main_modular (Writer<mode> *writer,const char *__restrictstr,internal::ArgList &args)Defined at line 26 of file ../../third_party/llvm-libc/src/src/__support/printf_core/printf_main.h
-
template <OverflowMode mode>int convert_char (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 30 of file ../../third_party/llvm-libc/src/src/__support/printf_core/char_converter.h
-
template <typename T>InfNanFPBitsProperties get_inf_nan_fp_bits_properties (AnyFloatStorageType float_raw)Defined at line 31 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_inf_nan_converter.h
-
template <typename T>InfNanFPBitsProperties get_inf_nan_fp_bits_properties (AnyFloatStorageType float_raw)Defined at line 31 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_inf_nan_converter.h
-
int PrintfImpl (int (*)(std::string_view, void *)write,void *hook,std::span<char>buffer,PrintfNewlinenewline,const char *format,va_listargs)Defined at line 31 of file ../../sdk/lib/c/stdio/printf_core/wrapper.cc
-
int PrintfImpl (int (*)(std::string_view, void *)write,void *hook,std::span<char>buffer,PrintfNewlinenewline,const char *format,va_listargs)Defined at line 31 of file ../../sdk/lib/c/stdio/printf_core/wrapper.cc
-
template <OverflowMode mode>int char_writer (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 31 of file ../../third_party/llvm-libc/src/src/__support/printf_core/string_converter.h
-
template <OverflowMode mode>int convert_float (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 32 of file ../../third_party/llvm-libc/src/src/__support/printf_core/converter.h
-
template <typename T>FloatHexExpFPBitsProperties get_float_hex_exp_fp_bits_properties (AnyFloatStorageType float_raw)Defined at line 37 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_hex_converter.h
-
template <typename T>FloatHexExpFPBitsProperties get_float_hex_exp_fp_bits_properties (AnyFloatStorageType float_raw)Defined at line 37 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_hex_converter.h
-
template <OverflowMode mode>int convert_int (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 65 of file ../../third_party/llvm-libc/src/src/__support/printf_core/int_converter.h
-
template <OverflowMode mode>int convert (Writer<mode> * writer, const FormatSection & to_conv)convert will call a conversion function to convert the FormatSection into
its string representation, and then that will write the result to the
writer.
Defined at line 66 of file ../../third_party/llvm-libc/src/src/__support/printf_core/converter.h
-
template <typename CharType>Writer<Mode<OverflowMode::DROP_OVERFLOW>::value, CharType> make_drop_overflow_writer (CharType * buffer, size_t buffer_len) -
template <typename CharType>Writer<Mode<OverflowMode::CALLBACK>::value, CharType> make_writer (CharType *buffer,size_tbuffer_len,OverflowWriteFn<CharType>callback,void *callback_state) -
template <OverflowMode mode, typename CharT>Writer<mode, CharT> <deduction guide for Writer> (CharT *,size_t,OverflowWriter<mode, CharT>)Class-template auto deduction helper.
-
template <typename T>cpp::enable_if_t<cpp::is_integral_v<T> || is_big_int_v<T>, bool> multiple_of_power_of_2 (T value, uint32_t p)Returns true if value is divisible by 2^p.
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <OverflowMode mode>int convert_inf_nan (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 42 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_inf_nan_converter.h
-
template <OverflowMode mode>ErrorOr<size_t> printf_main (Writer<mode> *writer,const char *__restrictstr,internal::ArgList &args)Defined at line 46 of file ../../third_party/llvm-libc/src/src/__support/printf_core/printf_main.h
-
template <OverflowMode mode>ErrorOr<size_t> printf_main (Writer<mode> *writer,const char *__restrictstr,internal::ArgList &args)Defined at line 46 of file ../../third_party/llvm-libc/src/src/__support/printf_core/printf_main.h
-
RoundDirection get_round_direction (intlast_digit,booltruncated,Signsign)constexpr size_t BLOCK_SIZE = 18;
constexpr uint32_t MAX_BLOCK = 999999999999999999;
Defined at line 50 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <OverflowMode mode>int convert_float_hex_exp (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 51 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_hex_converter.h
-
template <typename CharT>int overflow_write_drop_overflow (WriteBuffer<CharT> &wb,cpp::basic_string_view<CharT>new_str,void *)Handles overflow by filling any remaining space in `wb` with the start of
`new_str`, and dropping any excess characters.
Defined at line 76 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <size_t BufferSize,PrintfNewline AddNewline = PrintfNewline::kNo,typename T>int Printf (T && write, const char * format)Defined at line 82 of file ../../sdk/lib/c/stdio/printf_core/wrapper.h
-
template <size_t BufferSize,PrintfNewline AddNewline = PrintfNewline::kNo,typename T>int Printf (T && write, const char * format)Defined at line 82 of file ../../sdk/lib/c/stdio/printf_core/wrapper.h
-
template <typename T>cpp::enable_if_t<cpp::is_integral_v<T> || is_big_int_v<T>, bool> zero_after_digits (int32_tbase_2_exp,int32_tdigits_after_point,Tmantissa,const int32_tmant_width)Defined at line 89 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <typename CharT, WriteSink<CharT> write_sink>int overflow_write_flush_to_sink (WriteBuffer<CharT> &wb,cpp::basic_string_view<CharT>new_str,void *sink_state)Flushes the current contents of `wb` to `write_sink`, followed by `new_str`.
Defined at line 92 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <size_t BufferSize,PrintfNewline AddNewline = PrintfNewline::kNo,typename T>auto MakePrintf (T write)This returns a move-only lambda the argument is moved into.
Calling it with ... calls Printf(write, ...).
Defined at line 93 of file ../../sdk/lib/c/stdio/printf_core/wrapper.h
-
template <size_t BufferSize,PrintfNewline AddNewline = PrintfNewline::kNo,typename T>auto MakePrintf (T write)This returns a move-only lambda the argument is moved into.
Calling it with ... calls Printf(write, ...).
Defined at line 93 of file ../../sdk/lib/c/stdio/printf_core/wrapper.h
-
template <OverflowMode mode>int convert_string (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 125 of file ../../third_party/llvm-libc/src/src/__support/printf_core/string_converter.h
-
template <typename CharT>void fill_buffer (CharT *dest,CharTvalue,size_tcount)Fills the `dest` buffer with `count` copies of `value`.
Defined at line 136 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <typename CharT>void fill_buffer (CharT *dest,CharTvalue,size_tcount)Fills the `dest` buffer with `count` copies of `value`.
Defined at line 136 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <typename CharType>Writer<Mode<OverflowMode::DROP_OVERFLOW>::value, CharType> make_drop_overflow_writer (CharType * buffer, size_t buffer_len) -
template <typename T>TypeDesc type_desc_from_type ()Defined at line 152 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
-
template <typename CharT>Writer<Mode<OverflowMode::DROP_OVERFLOW>::value, CharT> make_drop_overflow_writer (CharT * buffer, size_t buffer_len)Defined at line 241 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <typename CharT>Writer<Mode<OverflowMode::DROP_OVERFLOW>::value, CharT> make_drop_overflow_writer (CharT * buffer, size_t buffer_len)Defined at line 241 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <typename CharType>Writer<Mode<OverflowMode::CALLBACK>::value, CharType> make_writer (CharType *buffer,size_tbuffer_len,OverflowWriteFn<CharType>callback,void *callback_state) -
template <OverflowMode mode, typename CharT>Writer<mode, CharT> <deduction guide for Writer> (CharT *,size_t,OverflowWriter<mode, CharT>)Class-template auto deduction helper.
-
template <typename CharT>Writer<OverflowMode::CALLBACK, CharT> make_writer (CharT *buffer,size_tbuffer_len,OverflowWriteFn<CharT>callback,void *callback_state)Defined at line 249 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <typename CharT>Writer<OverflowMode::CALLBACK, CharT> make_writer (CharT *buffer,size_tbuffer_len,OverflowWriteFn<CharT>callback,void *callback_state)Defined at line 249 of file ../../third_party/llvm-libc/src/src/__support/printf_core/writer.h
-
template <typename T,OverflowMode mode,cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>int convert_float_decimal_typed (Writer<mode> *writer,const FormatSection &to_conv,fputil::FPBits<T>float_bits)This implementation is based on the Ryu Printf algorithm by Ulf Adams:
Ulf Adams. 2019. Ryƫ revisited: printf floating point conversion.
Proc. ACM Program. Lang. 3, OOPSLA, Article 169 (October 2019), 23 pages.
https://doi.org/10.1145/3360595
Defined at line 492 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <typename T,OverflowMode mode,cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>int convert_float_dec_exp_typed (Writer<mode> *writer,const FormatSection &to_conv,fputil::FPBits<T>float_bits)Defined at line 602 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <typename T,OverflowMode mode,cpp::enable_if_t<cpp::is_floating_point_v<T>, int> = 0>int convert_float_dec_auto_typed (Writer<mode> *writer,const FormatSection &to_conv,fputil::FPBits<T>float_bits)Defined at line 763 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <OverflowMode mode>int convert_float_decimal (Writer<mode> * writer, const FormatSection & to_conv)TODO: unify the float converters to remove the duplicated checks for inf/nan.
Defined at line 1130 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <OverflowMode mode>int convert_float_dec_exp (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 1166 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
-
template <OverflowMode mode>int convert_float_dec_auto (Writer<mode> * writer, const FormatSection & to_conv)Defined at line 1202 of file ../../third_party/llvm-libc/src/src/__support/printf_core/float_dec_converter.h
Variables
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const char char_constant_v
Defined at line 38 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h
const CharT char_constant_v
Defined at line 39 of file ../../third_party/llvm-libc/src/src/__support/printf_core/core_structs.h