Container class for SafePrint functions. More...
Classes | |
struct | OutputTypeAndFlags_t |
struct | ParamInfo_t |
Container struct for SafePrint arguments. More... | |
struct | ProcessResults_t |
struct to hold the results of parsing. More... | |
Static Public Member Functions | |
static const char * | GetWarningDescription (eWarningFlags uFlags) noexcept |
Convert error flag to message in English. | |
static eOpcode | GetDefaultArgumentType (const ArgumentType *pArg) noexcept |
Get the default opcode from the argument data type. | |
static const char * | GetOutputDisplayType (eConversionSpecifier uType) noexcept |
Convert conversion specifier to message in English. | |
static const char * | GetOutputCommandName (eConversionCommand uCommand) noexcept |
Convert conversion command to message in English. | |
Static Public Attributes | |
static const uint_t | kMIN_FLOAT_EXPONENT_DIGITS = 2 |
ISO/IEC 9899:TC2 spec for minimum exponent digits. | |
static const uint_t | kMAX_OUTPUT_COMMANDS = 64 |
Maximum number of passed parameters. | |
static const uintptr_t | kMaxPrintFPrecision = 4095 |
Largest number of character precision to print for a floating point number. | |
static const uintptr_t | kMaxPrintFWidth = 4095 |
Largest number of digits to print for a floating point number. | |
static const uintptr_t | kMAX_CONVERSION_OUTPUT_SIZE = 4095 |
Largest size of a single argument in bytes. | |
static const uintptr_t | kMAX_TOTAL_OUTPUT_SIZE = 128 * 1024 |
Maximum size of the total output (Sanity check) | |
static const eOpcode | g_CodeMap [128] |
Mapping table for UTF-8 characters to SafePrint opcodes. | |
static const eConversionFlags | g_PrintFlagMappings [5] |
Mapping table for OP_FLAG_* for printing. | |
static const eConversionFlags | g_PrintfLengthMappings [6] |
Mapping table for OP_LENGTH_* for printing. | |
static const OutputTypeAndFlags_t | g_PrintfOutputType [22] |
Mapping table for OP_OUTPUT_* for printing. | |
static const uintptr_t | g_ConversionArgumentSizes [14] |
CONVSPEC_* expected data sizes. | |
static const uint32_t | g_ValidFlagsForConversion [14] |
CONVSPEC_* valid output conversion flags. | |
static const uint32_t | g_ValidOutputDisplayTypesStrict [kArgumentTypeCount] |
ARG_* valid output conversion flags. | |
static const uint32_t | g_ValidOutputDisplayTypesRelaxed [kArgumentTypeCount] |
ARG_* valid output relaxed conversion flags. | |
Container class for SafePrint functions.
This class contains all the static functions to handle the safe printf for Burgerlib.
typedef uint_t( * Burger::SafePrint::SprintfCallbackProc) (uint_t bNoErrors, uintptr_t uRequestedSize, void **ppOutputBuffer, void *pContext) |
Enumerator | |
---|---|
CONVFLAG_NO_OPTIONS | No formatting options. |
CONVFLAG_LEFT_JUSTIFY | Left justification turned on. |
CONVFLAG_DISPLAY_SIGN | Display the - or + sign. |
CONVFLAG_BLANK_SIGN | Don't display a sign. |
CONVFLAG_ALTERNATIVE_FORM | Alternative form. |
CONVFLAG_LEFT_PAD_ZEROS | Pad the left with zeros. |
CONVFLAG_COMMA_SEPARATE | Comma separate numbers. |
CONVFLAG_UPPERCASE | Force text to uppercase. |
CONVFLAG_INTERPRET_SHORT | Interpret argument as a uint16_t. |
CONVFLAG_INTERPRET_SSHORT | Interpret argument as a int16_t. |
CONVFLAG_INTERPRET_LONG | Interpret argument as a uint64_t. |
CONVFLAG_INTERPRET_LLONG | Interpret argument as a int64_t. |
CONVFLAG_INTERPRET_DOUBLE | Interpret argument as a float. |
CONVFLAG_INTERPRET_INTMAX | Interpret argument as an integer. |
CONVFLAG_INTERPRET_SIZET | Interpret argument as a uintptr_t (size_t) |
CONVFLAG_INTERPRET_WORDPTR | Interpret argument as a uintptr_t. |
CONVFLAG_INTERPRET_WORD | Interpret argument as unsigned. |
CONVFLAG_INTERPRET_SPECIFIED | Interpretation is specified. |
CONVFLAG_WIDTH_SPECIFIED | Width parameter was specified. |
CONVFLAG_PRECISION_SPECIFIED | Precision parameter was specified. |
CONVFLAG_PRECISION_MARKER | Precision marker was specified. |
CONVFLAG_OUTPUT_WCHAR | "C" string is wide |
CONVFLAG_HAS_SEQUENCE_CHAR | Used by COPY_TEXT Command. |
|
staticnoexcept |
Get the default opcode from the argument data type.
pArg | Error code |
|
staticnoexcept |
Convert conversion command to message in English.
uCommand | Command to convert |
|
staticnoexcept |
Convert conversion specifier to message in English.
uType | Specifier type to convert |
|
staticnoexcept |
Convert error flag to message in English.
uFlags | Error code |
|
static |
Mapping table for UTF-8 characters to SafePrint opcodes.
Mapping table for ASCII/UTF-8 characters ranged 0-127 used do decode/parse a character that is part of a conversion specification.
! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ del
CONVSPEC_* expected data sizes.
Table of expected argument sizes for each conversion
|
static |
Mapping table for OP_FLAG_* for printing.
Lookup table to convert eOpcode in the OP_FLAG_* range to the appropriate conversion formatting flag
|
static |
Mapping table for OP_LENGTH_* for printing.
Lookup table to convert eOpcode in the OP_LENGTH_* range to the appropriate conversion argument length modifier
|
static |
Mapping table for OP_OUTPUT_* for printing.
Lookup table to convert eOpcode in the OP_OUTPUT_* range to the actual output conversion specification and includes any additional formatting options that are needed (such as using upper case characters) and info the expected argument type (which we only use to issue warnings)
CONVSPEC_* valid output conversion flags.
Table of which flags are valid for what output conversions
ARG_* valid output relaxed conversion flags.
Bit table of Additional Valid output conversion specifiers for each argument type when allowing for "relaxed" conversions
ARG_* valid output conversion flags.
Bit table of Valid output conversion specifiers for each argument type when applying strict argument conversion rules
Largest size of a single argument in bytes.
Maximum number of passed parameters.
Maximum size of the total output (Sanity check)
Largest number of character precision to print for a floating point number.
Largest number of digits to print for a floating point number.