clang 22.0.0git
clang::NumericLiteralCaseStyle Struct Reference

Separate control for each numeric literal component. More...

#include "clang/Format/Format.h"

Public Member Functions

bool operator== (const NumericLiteralCaseStyle &R) const
bool operator!= (const NumericLiteralCaseStyle &R) const

Public Attributes

NumericLiteralComponentStyle ExponentLetter
 Format floating point exponent separator letter case.
NumericLiteralComponentStyle HexDigit
 Format hexadecimal digit case.
NumericLiteralComponentStyle Prefix
 Format integer prefix case.
NumericLiteralComponentStyle Suffix
 Format suffix case. This option excludes case-sensitive reserved suffixes, such as min in C++.

Detailed Description

Separate control for each numeric literal component.

For example, the config below will leave exponent letters alone, reformat hexadecimal digits in lowercase, reformat numeric literal prefixes in uppercase, and reformat suffixes in lowercase.

HexDigit: Lower
Prefix: Upper
Suffix: Lower
NumericLiteralCaseStyle NumericLiteralCase
Capitalization style for numeric literals.
Definition Format.h:3841
NumericLiteralComponentStyle ExponentLetter
Format floating point exponent separator letter case.
Definition Format.h:3805
NumericLiteralComponentStyle Suffix
Format suffix case. This option excludes case-sensitive reserved suffixes, such as min in C++.
Definition Format.h:3827
NumericLiteralComponentStyle Prefix
Format integer prefix case.
Definition Format.h:3819
NumericLiteralComponentStyle HexDigit
Format hexadecimal digit case.
Definition Format.h:3812

Definition at line 3798 of file Format.h.

Member Function Documentation

◆ operator!=()

bool clang::NumericLiteralCaseStyle::operator!= ( const NumericLiteralCaseStyle & R) const
inline

Definition at line 3834 of file Format.h.

◆ operator==()

bool clang::NumericLiteralCaseStyle::operator== ( const NumericLiteralCaseStyle & R) const
inline

Definition at line 3829 of file Format.h.

References ExponentLetter, HexDigit, Prefix, and Suffix.

Member Data Documentation

◆ ExponentLetter

NumericLiteralComponentStyle clang::NumericLiteralCaseStyle::ExponentLetter

Format floating point exponent separator letter case.

float a = 6.02e23 + 1.0E10; // Leave
float a = 6.02E23 + 1.0E10; // Upper
float a = 6.02e23 + 1.0e10; // Lower

Definition at line 3805 of file Format.h.

Referenced by operator==().

◆ HexDigit

NumericLiteralComponentStyle clang::NumericLiteralCaseStyle::HexDigit

Format hexadecimal digit case.

a = 0xaBcDeF; // Leave
a = 0xABCDEF; // Upper
a = 0xabcdef; // Lower

Definition at line 3812 of file Format.h.

Referenced by operator==().

◆ Prefix

NumericLiteralComponentStyle clang::NumericLiteralCaseStyle::Prefix

Format integer prefix case.

a = 0XF0 | 0b1; // Leave
a = 0XF0 | 0B1; // Upper
a = 0xF0 | 0b1; // Lower

Definition at line 3819 of file Format.h.

Referenced by operator==().

◆ Suffix

NumericLiteralComponentStyle clang::NumericLiteralCaseStyle::Suffix

Format suffix case. This option excludes case-sensitive reserved suffixes, such as min in C++.

a = 1uLL; // Leave
a = 1ULL; // Upper
a = 1ull; // Lower

Definition at line 3827 of file Format.h.

Referenced by operator==().


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