class integer_format


class integer_format

Description

An integer format is an object that provides the information that a formatter needs to turn an integer value into a string, and the information that a parser needs to turn a string into an integer value.

Public Member Functions

integer_format ()
noexcept

Construct a default integer format, where the radix is 10, the sign status is sign_status::only_when_negative, and the thousands separator is thousands_separator::none.

integer_format (
    unsigned int initial_radix,
    sign_status initial_sign_status,
    thousands_separator initial_thousands_separator
)

Construct an integer format with the given radix, sign status and thousands separator.

Parameters:
  • initial_radix:

    The radix.

  • initial_sign_status:

    The sign status.

  • initial_thousands_separator:

    The thousands separator.

integer_format (
    const integer_format& other
)

Copy-constructs an integer_format from an existing one.

Parameters:
  • other:

    The integer_format to copy from.

integer_format&
operator = (
    const integer_format& other
)

Copy-assigns an integer_format into this one.

Parameters:
  • other:

    The integer_format to copy from.

integer_format (
    integer_format&& other
)
noexcept

Move-constructs an integer_format from an existing one.

Parameters:
  • other:

    The integer_format to move from.

integer_format&
operator = (
    integer_format&& other
)
noexcept

Move-assigns an integer_format into this one.

Parameters:
  • other:

    The integer_format to move from.

unsigned int
get_radix ()
const noexcept

Returns the radix of this integer format.

void
set_radix (
    unsigned int new_radix
)
noexcept

Sets the radix of this integer format.

Parameters:
  • new_radix:

    The new radix of this integer format.

sign_status
get_sign_status ()
const noexcept

Returns the sign status of this integer format.

void
set_sign_status (
    sign_status new_sign_status
)
noexcept

Sets the sign status of this integer format.

Parameters:
  • new_sign_status:

    The new sign status of this integer format.

thousands_separator
get_thousands_separator ()
const noexcept

Returns the thousands separator of this integer format.

void
set_thousands_separator (
    thousands_separator new_thousands_separator
)
noexcept

Sets the thousands separator of this integer format.

Parameters:
  • new_thousands_separator:

    The new thousands separator of this integer format.



Copyright © 2022-2025 Daniel T. McGinnis

CCL was first published in 2022, and is still actively maintained.

This website was first published in 2022, and is still actively maintained.

This specific web page was first published in 2023.