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:4057
NumericLiteralComponentStyle Suffix
Format suffix case.
Definition Format.h:4079
NumericLiteralComponentStyle Prefix
Format integer prefix case.
Definition Format.h:4071
NumericLiteralComponentStyle HexDigit
Format hexadecimal digit case.
Definition Format.h:4064
NumericLiteralCaseStyle NumericLiteralCase
Capitalization style for numeric literals.
Definition Format.h:4093

Definition at line 4050 of file Format.h.

Member Function Documentation

◆ operator!=()

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

Definition at line 4086 of file Format.h.

◆ operator==()

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

Definition at line 4081 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 4057 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 4064 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 4071 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 4079 of file Format.h.


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