ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 166 of file formatterstdimpl.hpp.

#include <formatterstdimpl.hpp>

Collaboration diagram for FormatterStdImpl::PlaceholderAttributes:
[legend]

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 AlignmentSpecified

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

Definition at line 226 of file formatterstdimpl.hpp.

◆ Arg

const Box* 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 172 of file formatterstdimpl.hpp.

◆ ArgIdx

int 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 200 of file formatterstdimpl.hpp.

◆ CutContent

int 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 217 of file formatterstdimpl.hpp.

◆ FillChar

character FillChar

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

Definition at line 250 of file formatterstdimpl.hpp.

◆ FormatSpec

Substring 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 178 of file formatterstdimpl.hpp.

◆ IsPercentage

bool 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 246 of file formatterstdimpl.hpp.

◆ 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 182 of file formatterstdimpl.hpp.

◆ PreviousArgIdx

int 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 206 of file formatterstdimpl.hpp.

◆ SignPaddingMode

bool 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 232 of file formatterstdimpl.hpp.

◆ Type

PHTypes 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 188 of file formatterstdimpl.hpp.

◆ TypeCode

character 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 255 of file formatterstdimpl.hpp.

◆ TypeCodePosition

int 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 222 of file formatterstdimpl.hpp.

◆ ValueAlignment

lang::Alignment ValueAlignment

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

Definition at line 193 of file formatterstdimpl.hpp.

◆ Width

int Width

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

Definition at line 210 of file formatterstdimpl.hpp.

◆ WriteBinOctHexPrefix

bool 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 241 of file formatterstdimpl.hpp.


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