Represents a standard format specifier with an optional precision. It wraps a format symbol (a single character, e.g. 'D', 'X', 'O', or '\0' for the default format) and an optional precision in the range [0, 99]. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.
More...
#include <standard_format.h>
Inherits System::Details::BoxableObjectBase.
|
| static constexpr uint8_t | NoPrecision = 0xFF |
| | The maximum precision value that can be specified. A precision of this value means "no explicit precision". More...
|
| |
| static constexpr char_t | DefaultFormatSymbol = u'\0' |
| | The symbol used to represent the default format. An instance whose Format equals this value (and whose Precision equals NoPrecision) is considered default. More...
|
| |
| static constexpr uint8_t | s_maxPrecision = 99 |
| | The maximum allowed precision value (inclusive) for a non-default format. More...
|
| |
Represents a standard format specifier with an optional precision. It wraps a format symbol (a single character, e.g. 'D', 'X', 'O', or '\0' for the default format) and an optional precision in the range [0, 99]. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.
◆ StandardFormat() [1/3]
| System::Buffers::StandardFormat::StandardFormat |
( |
| ) |
|
|
inlinenoexcept |
Constructs a default StandardFormat that represents the default format.
◆ StandardFormat() [2/3]
| System::Buffers::StandardFormat::StandardFormat |
( |
char_t |
symbol | ) |
|
|
explicit |
Constructs a StandardFormat with the specified format symbol and no precision.
- Parameters
-
| symbol | A single character that identifies a standard format specifier. |
◆ StandardFormat() [3/3]
| System::Buffers::StandardFormat::StandardFormat |
( |
char_t |
symbol, |
|
|
uint8_t |
precision |
|
) |
| |
Constructs a StandardFormat with the specified format symbol and precision.
- Parameters
-
| symbol | A single character that identifies a standard format specifier. |
| precision | The number of digits to use, or NoPrecision to indicate no precision. |
- Exceptions
-
| ArgumentOutOfRangeException | if precision is neither NoPrecision nor in the range [0, 99]. |
◆ Equals()
| bool System::Buffers::StandardFormat::Equals |
( |
const StandardFormat & |
other | ) |
const |
|
noexcept |
Determines whether the current instance is equal to the specified one.
- Parameters
-
- Returns
- True if both instances have the same format symbol and precision; otherwise, false.
◆ get_Format()
| char_t System::Buffers::StandardFormat::get_Format |
( |
| ) |
const |
|
inlinenoexcept |
Gets the standard format symbol.
- Returns
- A single character identifying the standard format specifier.
◆ get_IsDefault()
| bool System::Buffers::StandardFormat::get_IsDefault |
( |
| ) |
const |
|
inlinenoexcept |
Determines whether this instance represents the default format.
- Returns
- True if the format symbol is the default symbol; otherwise, false.
◆ get_Precision()
| uint8_t System::Buffers::StandardFormat::get_Precision |
( |
| ) |
const |
|
inlinenoexcept |
Gets the precision (number of digits) for this format, or NoPrecision if none.
- Returns
- The precision value.
◆ GetHashCode()
| int32_t System::Buffers::StandardFormat::GetHashCode |
( |
| ) |
const |
|
noexcept |
Returns a hash code for the current StandardFormat.
- Returns
- An int32_t hash code derived from the format symbol and precision.
◆ ToString()
| String System::Buffers::StandardFormat::ToString |
( |
| ) |
const |
Returns a string representation of the current StandardFormat. Default format instances are represented as "default"; otherwise the representation is the format symbol optionally followed by the precision, e.g. "X", "X4", "O".
- Returns
- The string representation of this instance.
◆ DefaultFormatSymbol
| constexpr char_t System::Buffers::StandardFormat::DefaultFormatSymbol = u'\0' |
|
staticconstexpr |
The symbol used to represent the default format. An instance whose Format equals this value (and whose Precision equals NoPrecision) is considered default.
◆ NoPrecision
| constexpr uint8_t System::Buffers::StandardFormat::NoPrecision = 0xFF |
|
staticconstexpr |
The maximum precision value that can be specified. A precision of this value means "no explicit precision".
Equivalent to byte.MaxValue in .NET.
◆ s_maxPrecision
| constexpr uint8_t System::Buffers::StandardFormat::s_maxPrecision = 99 |
|
staticconstexpr |
The maximum allowed precision value (inclusive) for a non-default format.