clang 24.0.0git
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:4048
NumericLiteralComponentStyle Suffix
Format suffix case.
Definition Format.h:4070
NumericLiteralComponentStyle Prefix
Format integer prefix case.
Definition Format.h:4062
NumericLiteralComponentStyle HexDigit
Format hexadecimal digit case.
Definition Format.h:4055
NumericLiteralCaseStyle NumericLiteralCase
Capitalization style for numeric literals.
Definition Format.h:4084

Definition at line 4041 of file Format.h.

Member Function Documentation

◆ operator!=()

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

Definition at line 4077 of file Format.h.

◆ operator==()

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

Definition at line 4072 of file Format.h.

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 4048 of file Format.h.

◆ HexDigit

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

Format hexadecimal digit case.

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

Definition at line 4055 of file Format.h.

◆ 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 4062 of file Format.h.

◆ 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 4070 of file Format.h.


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