clang 24.0.0git
clang::format::FormatStyle::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.

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
NumericLiteralComponentStyle ExponentLetter
Format floating point exponent separator letter case.
Definition Format.h:4121
NumericLiteralComponentStyle Suffix
Format suffix case.
Definition Format.h:4143
NumericLiteralComponentStyle Prefix
Format integer prefix case.
Definition Format.h:4135
NumericLiteralComponentStyle HexDigit
Format hexadecimal digit case.
Definition Format.h:4128
NumericLiteralCaseStyle NumericLiteralCase
Capitalization style for numeric literals.
Definition Format.h:4157

Definition at line 4114 of file Format.h.

Member Function Documentation

◆ operator!=()

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

Definition at line 4150 of file Format.h.

References ExponentLetter, HexDigit, Prefix, and Suffix.

◆ operator==()

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

Definition at line 4145 of file Format.h.

References Suffix.

Member Data Documentation

◆ ExponentLetter

NumericLiteralComponentStyle clang::format::FormatStyle::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 4121 of file Format.h.

Referenced by operator!=().

◆ HexDigit

NumericLiteralComponentStyle clang::format::FormatStyle::NumericLiteralCaseStyle::HexDigit

Format hexadecimal digit case.

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

Definition at line 4128 of file Format.h.

Referenced by operator!=().

◆ Prefix

NumericLiteralComponentStyle clang::format::FormatStyle::NumericLiteralCaseStyle::Prefix

Format integer prefix case.

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

Definition at line 4135 of file Format.h.

Referenced by operator!=().

◆ Suffix

NumericLiteralComponentStyle clang::format::FormatStyle::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 4143 of file Format.h.

Referenced by operator!=(), and operator==().


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