ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::format::FormatterStdImpl::PlaceholderAttributes Struct Reference

Description:

Collection of attributes related to the current placeholder processed.

Note
The members of this inner class could as well be rightful members of the outer class. One object of this inner type is created as a normal member. Hence, the only reason for gathering the fields in this inner type is readability. (It has no influence on the compilation result.)

Definition at line 161 of file formatterstdimpl.inl.

Public Field Index:

bool AlignmentSpecified
const BoxArg
int ArgIdx
int CutContent
character FillChar
Substring FormatSpec
bool IsPercentage
NumberFormat NF
int PreviousArgIdx
bool SignPaddingMode
PHTypes Type
character TypeCode
int TypeCodePosition
lang::Alignment ValueAlignment
int Width
bool WriteBinOctHexPrefix

Field Details:

◆ AlignmentSpecified

bool alib::format::FormatterStdImpl::PlaceholderAttributes::AlignmentSpecified

If true, an alignment was explicitly specified. This is set to false in the default implementation of resetPlaceholder.

Definition at line 221 of file formatterstdimpl.inl.

◆ Arg

const Box* alib::format::FormatterStdImpl::PlaceholderAttributes::Arg

The current Box. This is set by parsePlaceholder if explicit indexing is used. Otherwise by format which invokes setArgument if parsePlaceholder did not set it yet. Set to nullptr in the default implementation of resetPlaceholder.

Definition at line 167 of file formatterstdimpl.inl.

◆ ArgIdx

int alib::format::FormatterStdImpl::PlaceholderAttributes::ArgIdx

The positional index of the current argument. This is set by parsePlaceholder if explicit indexing is used. Otherwise by format which invokes setArgument if parsePlaceholder did not set it yet. Set to -1 in the default implementation of resetPlaceholder.

Definition at line 195 of file formatterstdimpl.inl.

◆ CutContent

int alib::format::FormatterStdImpl::PlaceholderAttributes::CutContent

If not negative, the string representation of the argument is cut before applying any field operation. It could be also named "precision", hence the number of characters to show - even if the field will be wider. This is set to -1 in the default implementation of resetPlaceholder.

Definition at line 212 of file formatterstdimpl.inl.

◆ FillChar

character alib::format::FormatterStdImpl::PlaceholderAttributes::FillChar

The filling character for fields that are larger than their content. Method resetPlaceholder will set this to ' '.

Definition at line 245 of file formatterstdimpl.inl.

◆ FormatSpec

Substring alib::format::FormatterStdImpl::PlaceholderAttributes::FormatSpec

The portion of the replacement field that represents the format specification. This field might be set in method parsePlaceholder and consumed in methods writeCustomFormat and parseStdFormatSpec.
This field is nulled in the default implementation of resetPlaceholder.

Definition at line 173 of file formatterstdimpl.inl.

◆ IsPercentage

bool alib::format::FormatterStdImpl::PlaceholderAttributes::IsPercentage

Can be true for float-types. If true, the value is multiplied with 100 and a percentage symbol '%' is printed after the value. Set to false in the default implementation of resetPlaceholder.

Definition at line 241 of file formatterstdimpl.inl.

◆ NF

NumberFormat alib::format::FormatterStdImpl::PlaceholderAttributes::NF

The number format object for the actual attribute. With method resetPlaceholder values found in object DefaultNumberFormat will be copied into this.

Definition at line 177 of file formatterstdimpl.inl.

◆ PreviousArgIdx

int alib::format::FormatterStdImpl::PlaceholderAttributes::PreviousArgIdx

The index of the previous argument. Used when addressing previous argument number (eg. in Java formatting style this could be "%<$..."). This is set to ArgIdx in the default implementation of resetPlaceholder.

Definition at line 201 of file formatterstdimpl.inl.

◆ SignPaddingMode

bool alib::format::FormatterStdImpl::PlaceholderAttributes::SignPaddingMode

Forces the padding to be placed after the sign (if any) but before the digits. This is used for printing fields in the form ‘+000000120'. This alignment option is only valid for numeric types. Set to false in the default implementation of resetPlaceholder.

Definition at line 227 of file formatterstdimpl.inl.

◆ Type

PHTypes alib::format::FormatterStdImpl::PlaceholderAttributes::Type

The type of the attribute as specified in the placeholder. This is set to PHTypes::NotGiven in the default implementation of resetPlaceholder.

Definition at line 183 of file formatterstdimpl.inl.

◆ TypeCode

character alib::format::FormatterStdImpl::PlaceholderAttributes::TypeCode

This is the (format-specific) type code of the current format operation. Used only to display error messages. May be used differently in derived classes. Is nulled in the default implementation of resetPlaceholder.

Definition at line 250 of file formatterstdimpl.inl.

◆ TypeCodePosition

int alib::format::FormatterStdImpl::PlaceholderAttributes::TypeCodePosition

This is the position in the format string where the actual type code was read from. Used for exception argument generation (FMTExceptions::IncompatibleTypeCode). If -1, the actual parse position is used.

Definition at line 217 of file formatterstdimpl.inl.

◆ ValueAlignment

lang::Alignment alib::format::FormatterStdImpl::PlaceholderAttributes::ValueAlignment

The alignment of the contents within a field. This is set to Left in the default implementation of resetPlaceholder.

Definition at line 188 of file formatterstdimpl.inl.

◆ Width

int alib::format::FormatterStdImpl::PlaceholderAttributes::Width

The (minimum) width of the output. This is set to 0 in the default implementation of resetPlaceholder.

Definition at line 205 of file formatterstdimpl.inl.

◆ WriteBinOctHexPrefix

bool alib::format::FormatterStdImpl::PlaceholderAttributes::WriteBinOctHexPrefix

Used with binary, octal, or hexadecimal output. Specifies that the output will be prefixed by strings found in fields BinLiteralPrefix, HexLiteralPrefix or OctLiteralPrefix which default to "0b", "0o" and "0x". Set to false in the default implementation of resetPlaceholder.

Definition at line 236 of file formatterstdimpl.inl.


The documentation for this struct was generated from the following file: