Container struct for SafePrint arguments. More...
Classes | |
struct | FloatDigitInfo_t |
Public Member Functions | |
eConversionCommand | GetCommand (void) const noexcept |
Get the eConversionCommand. | |
void | SetCommand (eConversionCommand uCommand) noexcept |
eConversionSpecifier | GetConversion (void) const noexcept |
Get the eConversionSpecifier. | |
void | SetConversion (eConversionSpecifier uOutputConversion) noexcept |
uint32_t | GetConversionAsFlag (void) const noexcept |
Get the eConversionSpecifier as a shifted flag. | |
uint_t | GetArgIndex (void) const noexcept |
Get the argument index. | |
void | SetArgIndex (uint_t uArgIndex) noexcept |
Set the argument index. | |
uint_t | GetWarnings (void) const noexcept |
Get the accumulated warnings. | |
void | SetWarning (eWarningFlags uWarning) noexcept |
Accumulate a warning. | |
uint32_t | GetFlags (void) const noexcept |
Get the accumulated eConversionFlags bits. | |
void | SetFlags (uint32_t uFormatOptionFlags) noexcept |
void | SetFlag (eConversionFlags uFormatOptionFlags) noexcept |
void | ClearFlag (eConversionFlags uFormatOptionFlags) noexcept |
uint_t | IsFlagSet (eConversionFlags uFormatOptionFlags) const noexcept |
void | ClearFlags (void) noexcept |
Clear the eConversionFlags bits. | |
uint_t | GetWidth (void) const noexcept |
Get the width of the output for the argument. | |
void | SetWidth (uint_t uCharacterWidth) noexcept |
Set the width of the output for the argument. | |
uint_t | GetPrecision (void) const noexcept |
Get the desired precision of the argument. | |
void | SetPrecision (uint_t uPrecision) noexcept |
Set the width of the output for the argument. | |
uintptr_t | GetFormattedLength (void) const noexcept |
Get the parsed length of the '%' command. | |
void | SetFormattedLength (uintptr_t uFormattedLength) noexcept |
Get the parsed length of the '%' command. | |
uintptr_t | GetOutputLength (void) const noexcept |
Get the length of the processed argument. | |
void | SetOutputLength (uintptr_t uOutputLength) noexcept |
Set the length of the processed argument. | |
void | SetFloatInfo (uint_t uIntSpecialDigits, uint_t uFracDigits, uint_t bSign, uint_t uDecimalPoint, uint_t uPadDigits, uint_t uExponentDigits) noexcept |
Set the parsed floating point information. | |
void | GetFloatInfo (uint_t *pIntSpecialDigits, uint_t *pFracDigits, uint_t *pSign, uint_t *pDecimalPoint, uint_t *pPadDigits, uint_t *pExponentDigits) const noexcept |
Get the parsed floating point information. | |
void | SetFloatAnalysisInfo (FPPrintInfo::eResult uFPInfoResult, uint_t uPadIntZeros, uint_t uPadFracZeros, uint_t uFirstNonZeroIntPos) noexcept |
Set the analyzed floating point information. | |
void | GetFloatAnalysisInfo (FPPrintInfo::eResult *pFPInfoResult, uint_t *pPadIntZeros, uint_t *pPadFracZeros, uint_t *pFirstNonZeroIntPos) const noexcept |
Get the analyzed floating point information. | |
void | SetFloatSpecialResult (FPPrintInfo::eResult uFPInfoResult, uint_t uIntSpecialDigits, uint_t uPadIntZeros, uint_t uIsNegative) noexcept |
Set the special floating point information for NAN or INF. | |
uint_t | GetFloatSpecialChars (void) const noexcept |
Get the number of special character for a special floating point number. | |
uint_t | GetFloatSpecialLeadingZeros (void) const noexcept |
Get the number leading zeros for a special floating point number. | |
uint_t | GetFloatSpecialIsNegative (void) const noexcept |
Is the special floating pointer number negative? | |
uintptr_t | PadFieldWidth (char *pOutBuffer) const noexcept |
Output padding for field width. | |
void | GetFormattedOutputLength (const ArgumentType *pArg) noexcept |
Calculate the number of character that will be printed for this argument. | |
void | CheckConversionFlags (void) noexcept |
Sanity check the conversion flags. | |
void | CheckConversionForWarnings (const ArgumentType *pArg) noexcept |
Sanity check the conversion modifier flags. | |
eError | StoreOffNumericValue (eParseStage uStage, uint32_t uCurrentNumValue) noexcept |
Store the precision or width value. | |
uintptr_t | FormatInteger (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Outputs an integer value. | |
uintptr_t | FormatHexOrOctal (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Outputs an integral value as octal or hex digits. | |
uintptr_t | FormatPointer (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Outputs an pointer as a hex address value. | |
uintptr_t | FormatChar (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Outputs a character value. | |
uintptr_t | FormatTextString (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Outputs a text string. | |
uintptr_t | FormatBool (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Outputs a boolean values value as "true"/"false". | |
uintptr_t | FormatBinary (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Output a data value as a binary bit pattern, MSB to LSB. | |
uintptr_t | FormatSpecialReal (char *pOutBuffer, FPPrintInfo::eResult uSpecialResult) const noexcept |
Print NaN's and Infinity. | |
uintptr_t | FormatReal (char *pOutBuffer, const ArgumentType *pArg) const noexcept |
Outputs a floating point value. | |
Public Attributes | ||
union { | ||
const char * m_pText | ||
Pointer to text if "C" string. More... | ||
FloatDigitInfo_t m_FloatInfo | ||
Info on the formatted float. More... | ||
}; | ||
Private Attributes | |
uint8_t | m_uCommand |
eConversionCommand micro command (copy memory, format argument) | |
uint8_t | m_uOutputConversion |
eConversionSpecifier output type of the argument | |
uint8_t | m_uArgIndex |
Source Argument Index. | |
uint8_t | m_uWarnings |
eWarningFlags Accumulated warnings found (Bits are OR'd together) | |
uint32_t | m_uFormatOptionFlags |
eConversionFlags Output Formatting Flags | |
uint16_t | m_uCharacterWidth |
Number of characters to print. | |
uint16_t | m_uPrecision |
Number of characters of numeric precision. | |
uint16_t | m_uFormattedLength |
Length of the section of formatted output in bytes. | |
uint16_t | m_uOutputLength |
Total Length (actual or estimated) of output (formatted + padding) in bytes. | |
Container struct for SafePrint arguments.
Describes a single conversion to be done It can represent a block of literal text to be copied or it can describe and argument to be converted
An array of ParamInfo_t objects is built during the parsing phase from the format string (with optional arguments) and contains the decoded and validated copy and formatted conversion commands that use the actual argument values to determine things like how many characters are outputted
|
noexcept |
Sanity check the conversion flags.
Checks the flags specified in a given conversion for validity. Compiler specific variations can be allowed here
Warnings are set if issues were detected and corrected.
|
noexcept |
Sanity check the conversion modifier flags.
Checks the flags specified in a given conversion modifier for validity. Compiler specific variations can be allowed here
Warnings are set if issues were detected and corrected.
|
inlinenoexcept |
Clear the specific flag stored in the structure. \sa ClearFlags(void), IsFlagSet(eConversionFlags) const, GetFlags(void)
const, SetFlags(uint32_t), or SetFlag(eConversionFlags)
|
inlinenoexcept |
|
noexcept |
Output a data value as a binary bit pattern, MSB to LSB.
Relevant flags and inputs:
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
noexcept |
Outputs a boolean values value as "true"/"false".
Relevant flags and inputs:
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
noexcept |
Outputs a character value.
Relevant flags and inputs:
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
noexcept |
Outputs an integral value as octal or hex digits.
Outputs an integral value as octal or hex digits also handles pointer conversion
Relevant flags and inputs:
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
noexcept |
Outputs an integer value.
Relevant flags and inputs:
Caveats:
Composes numeric text from right to left (Except for padding)
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
noexcept |
Outputs an pointer as a hex address value.
Relevant flags and inputs:
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
noexcept |
Outputs a floating point value.
Relevant flags and inputs:
Caveats:
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
noexcept |
Print NaN's and Infinity.
Helper function to write out the text for special floating point values: NaN's and Infinity
pOutBuffer | Pointer to the buffer to store the printed string |
uSpecialResult | Special floating point number to print |
|
noexcept |
Outputs a text string.
Relevant flags and inputs:
pOutBuffer | Pointer to the buffer to store the printed string |
pArg | Pointer to the argument value |
|
inlinenoexcept |
Get the argument index.
This structure stores this as a byte for compactness, this accessor enforces type safety
\return The index into the argument array this structure refers to \sa SetArgIndex(uint_t)
|
inlinenoexcept |
Get the eConversionCommand.
const
This structure stores this as a byte for compactness, this accessor enforces
type safety
\return The stored \ref eConversionCommand \sa SetCommand(eConversionCommand)
|
inlinenoexcept |
Get the eConversionSpecifier.
const
This structure stores this as a byte for compactness, this accessor enforces
type safety
\return The stored \ref eConversionSpecifier \sa SetConversion(eConversionSpecifier) or GetConversionAsFlag(void) const
|
inlinenoexcept |
Get the eConversionSpecifier as a shifted flag.
Get the value of 1 << eConversionSpecifier
|
inlinenoexcept |
Get the accumulated eConversionFlags bits.
The individual bits are defined in eConversionFlags .
|
noexcept |
Get the analyzed floating point information.
This structure stores these variables in a compact fashion, this accessor enforces type safety
pFPInfoResult | Pointer to the type of floating point number detected |
pPadIntZeros | Pointer to the number of characters to pad on the integer |
pPadFracZeros | Pointer to the number of character to pad on the fraction |
pFirstNonZeroIntPos | Pointer to the position of the first non-zero digit in the integer |
|
noexcept |
Get the parsed floating point information.
This structure stores these variables in a compact fashion, this accessor enforces type safety
pIntSpecialDigits | Pointer to store the number of digits to the left of the decimal point |
pFracDigits | Pointer to store the Number of digits to the right of the decimal point |
pSign | Pointer to store TRUE or FALSE if a sign flag should be displayed |
pDecimalPoint | Pointer to store TRUE or FALSE if a decimal point should be displayed |
pPadDigits | Pointer to store the number of digits to pad |
pExponentDigits | Pointer to store the number of exponent digits |
|
inlinenoexcept |
Get the number of special character for a special floating point number.
|
inlinenoexcept |
Is the special floating pointer number negative?
const
|
inlinenoexcept |
Get the number leading zeros for a special floating point number.
const
|
inlinenoexcept |
Get the parsed length of the '%' command.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
|
noexcept |
Calculate the number of character that will be printed for this argument.
Gets the actual # of characters that will be output given the argument passed in and the format options
pArg | Pointer to a ArgumentType to check |
|
inlinenoexcept |
Get the length of the processed argument.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
|
inlinenoexcept |
Get the desired precision of the argument.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
\return The precision requested for the argument \sa SetPrecision(uint_t)
|
inlinenoexcept |
Get the accumulated warnings.
This structure stores this as a byte for compactness, this accessor enforces type safety
\return The accumulated warning bits \sa SetWarning(eWarningFlags)
|
inlinenoexcept |
Get the width of the output for the argument.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
\return The width override parsed in the "C" string \sa SetWidth(uint_t)
|
inlinenoexcept |
Test if the specific flag is set and return \ref TRUE if so, otherwise
return FALSE.
\param uFormatOptionFlags The single type safe flag to test against \return \ref TRUE if set, \ref FALSE if not. \sa SetFlag(eConversionFlags), GetFlags(void) const, SetFlags(uint32_t), or
|
noexcept |
Output padding for field width.
Handles the case when a field width is specified and and it's wider than the formatted argument output. Fills in the remainder of the field with the pad character and handles any justification
pOutBuffer | Pointer to the output buffer |
|
inlinenoexcept |
Set the argument index.
This structure stores this as a byte for compactness, this accessor enforces type safety
\param uArgIndex The new index into the argument array this structure refers
to
|
inlinenoexcept |
This structure stores this as a byte for compactness, this accessor enforces
type safety
\param uCommand The \ref eConversionCommand to store in the structure \sa GetCommand(void) const
|
inlinenoexcept |
This structure stores this as a byte for compactness, this accessor enforces
type safety
\param uOutputConversion The \ref eConversionSpecifier to store in the
structure
|
inlinenoexcept |
Or the specific flag into the flags. \param uFormatOptionFlags The single type safe flag to accumulate into the
structure
|
inlinenoexcept |
The individual bits are defined in \ref eConversionFlags. \param uFormatOptionFlags All of the \ref eConversionFlags to store in the
structure
|
noexcept |
Set the analyzed floating point information.
This structure stores these variables in a compact fashion, this accessor enforces type safety
uFPInfoResult | Type of floating point number detected |
uPadIntZeros | Number of characters to pad on the integer |
uPadFracZeros | Number of character to pad on the fraction |
uFirstNonZeroIntPos | Position of the first non-zero digit in the integer |
|
noexcept |
Set the parsed floating point information.
This structure stores these variables in a compact fashion, this accessor enforces type safety
\param uIntSpecialDigits Number of digits to the left of the decimal point \param uFracDigits Number of digits to the right of the decimal point \param bSign \ref TRUE if a sign flag should be displayed \param uDecimalPoint \ref TRUE if a decimal point should be displayed \param uPadDigits Number of digits to pad \param uExponentDigits Number of exponent digits \sa GetFloatInfo(uint_t *,uint_t *,uint_t *,uint_t *,uint_t *,uint_t *)
const
|
noexcept |
Set the special floating point information for NAN or INF.
This structure stores these variables in a compact fashion, this accessor enforces type safety
uFPInfoResult | Type of floating point number detected |
uIntSpecialDigits | Number of characters in the string |
uPadIntZeros | Number of characters to pad on the integer |
uIsNegative | Set to non-zero if negative |
|
inlinenoexcept |
Get the parsed length of the '%' command.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
uFormattedLength | The new number of bytes in the parsed "C" string this format code occupies |
|
inlinenoexcept |
Set the length of the processed argument.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
uOutputLength | The new number of bytes the printed argument will occupy |
|
inlinenoexcept |
Set the width of the output for the argument.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
uPrecision | The new precision requested for the argument |
|
inlinenoexcept |
Accumulate a warning.
Take the warning flag and OR it into the existing warning state. This function does not clear any previous bits.
This structure stores this as a byte for compactness, this accessor enforces
type safety.
\param uWarning The warning bit to set in the \ref m_uWarnings member
variable
|
inlinenoexcept |
Set the width of the output for the argument.
This structure stores this as a uint16_t for compactness, this accessor enforces type safety
\param uCharacterWidth The new width of the output for the argument \sa GetWidth(void) const
|
noexcept |
Store the precision or width value.
When a precision or width value is parsed, store it in the appropriate variable in the structure
uStage | Parsing stage to determine if parsing precision or width |
uCurrentNumValue | Value to store |
union { ... } Burger::SafePrint::ParamInfo_t |
FloatDigitInfo_t Burger::SafePrint::ParamInfo_t::m_FloatInfo |
Info on the formatted float.
const char* Burger::SafePrint::ParamInfo_t::m_pText |
Pointer to text if "C" string.
|
private |
Source Argument Index.
|
private |
Number of characters to print.
|
private |
eConversionCommand micro command (copy memory, format argument)
|
private |
eConversionFlags Output Formatting Flags
|
private |
Length of the section of formatted output in bytes.
|
private |
eConversionSpecifier output type of the argument
|
private |
Total Length (actual or estimated) of output (formatted + padding) in bytes.
|
private |
Number of characters of numeric precision.
|
private |
eWarningFlags Accumulated warnings found (Bits are OR'd together)