IgrOS-Kernel 0.1.34.545
Simple C++20 Kernel for i386/x86_64
Loading...
Searching...
No Matches
igros::klib::anonymous_namespace{kPrint.cpp} Namespace Reference

Format implementation details. More...

Classes

struct  spec_t
 Conversion specification. More...
class  writer_t
 Output buffer writer: never writes past last position (reserved for terminator). More...

Enumerations

enum class  argSize_t : igros_byte_t {
  BYTE , WORD , DWORD , QUAD ,
  SIZE
}
 Argument size (length modifier). More...

Functions

template<std::integral T>
void putInteger (writer_t &out, const T value, const radix_t radix, const spec_t &spec, const bool upper=false) noexcept
 Integer with sign (signed types, decimal only) and padding.
void putArgument (writer_t &out, std::va_list &list, const radix_t radix, const spec_t &spec, const bool isSigned, const bool upper) noexcept
 Integer argument of given size: signed or unsigned.
auto parseSpec (const char *&fmt) noexcept -> spec_t
 Parse flags, field width and length modifier of a placeholder.

Detailed Description

Format implementation details.

Enumeration Type Documentation

◆ argSize_t

enum class igros::klib::anonymous_namespace{kPrint.cpp}::argSize_t : igros_byte_t
strong

Argument size (length modifier).

Enumerator
BYTE 

hh

WORD 

h

DWORD 

(none)

QUAD 

ll (l on 64-bit)

SIZE 

z, t

Definition at line 41 of file kPrint.cpp.

Function Documentation

◆ parseSpec()

auto igros::klib::anonymous_namespace{kPrint.cpp}::parseSpec ( const char *& fmt) ->spec_t
nodiscardnoexcept

Parse flags, field width and length modifier of a placeholder.

(fmt points to '' on entry, to the last parsed character on return)

Parameters
fmtFormat position (advanced past parsed characters)
Returns
Parsed specification

Definition at line 207 of file kPrint.cpp.

◆ putArgument()

void igros::klib::anonymous_namespace{kPrint.cpp}::putArgument ( writer_t & out,
std::va_list & list,
const radix_t radix,
const spec_t & spec,
const bool isSigned,
const bool upper )
noexcept

Integer argument of given size: signed or unsigned.

Parameters
outOutput writer
listArguments (one is taken)
radixRadix
specConversion specification (argument size)
isSignedSigned conversion
upperUppercase hexadecimal digits

Definition at line 168 of file kPrint.cpp.

◆ putInteger()

template<std::integral T>
void igros::klib::anonymous_namespace{kPrint.cpp}::putInteger ( writer_t & out,
const T value,
const radix_t radix,
const spec_t & spec,
const bool upper = false )
noexcept

Integer with sign (signed types, decimal only) and padding.

Template Parameters
TInteger type
Parameters
outOutput writer
valueValue
radixRadix (sign for decimal only)
specField width and padding flags
upperUppercase hexadecimal digits

Definition at line 150 of file kPrint.cpp.