clang 19.0.0git
Public Member Functions | Public Attributes | List of all members
clang::format::FormatStyle::SpacesInParensCustom Struct Reference

Precise control over the spacing in parentheses. More...

#include "clang/Format/Format.h"

Public Member Functions

 SpacesInParensCustom ()
 
 SpacesInParensCustom (bool InConditionalStatements, bool InCStyleCasts, bool InEmptyParentheses, bool Other)
 
bool operator== (const SpacesInParensCustom &R) const
 
bool operator!= (const SpacesInParensCustom &R) const
 

Public Attributes

bool InConditionalStatements
 Put a space in parentheses only inside conditional statements (for/if/while/switch...).
 
bool InCStyleCasts
 Put a space in C style casts.
 
bool InEmptyParentheses
 Put a space in parentheses only if the parentheses are empty i.e.
 
bool Other
 Put a space in parentheses not covered by preceding options.
 

Detailed Description

Precise control over the spacing in parentheses.

# Should be declared this way:
Other: true
bool Other
Put a space in parentheses not covered by preceding options.
Definition: Format.h:4649
bool InConditionalStatements
Put a space in parentheses only inside conditional statements (for/if/while/switch....
Definition: Format.h:4626
SpacesInParensStyle SpacesInParens
If true, spaces will be inserted after ( and before ).
Definition: Format.h:4608
SpacesInParensCustom SpacesInParensOptions
Control of individual spaces in parentheses.
Definition: Format.h:4684

Definition at line 4618 of file Format.h.

Constructor & Destructor Documentation

◆ SpacesInParensCustom() [1/2]

clang::format::FormatStyle::SpacesInParensCustom::SpacesInParensCustom ( )
inline

Definition at line 4651 of file Format.h.

◆ SpacesInParensCustom() [2/2]

clang::format::FormatStyle::SpacesInParensCustom::SpacesInParensCustom ( bool  InConditionalStatements,
bool  InCStyleCasts,
bool  InEmptyParentheses,
bool  Other 
)
inline

Definition at line 4655 of file Format.h.

Member Function Documentation

◆ operator!=()

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

Definition at line 4666 of file Format.h.

◆ operator==()

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

Definition at line 4661 of file Format.h.

References InConditionalStatements, InCStyleCasts, InEmptyParentheses, and Other.

Member Data Documentation

◆ InConditionalStatements

bool clang::format::FormatStyle::SpacesInParensCustom::InConditionalStatements

Put a space in parentheses only inside conditional statements (for/if/while/switch...).

true: false:
if ( a ) { ... } vs. if (a) { ... }
while ( i < 5 ) { ... } while (i < 5) { ... }

Definition at line 4626 of file Format.h.

Referenced by llvm::yaml::MappingTraits< FormatStyle >::mapping(), and operator==().

◆ InCStyleCasts

bool clang::format::FormatStyle::SpacesInParensCustom::InCStyleCasts

Put a space in C style casts.

true: false:
x = ( int32 )y vs. x = (int32)y

Definition at line 4632 of file Format.h.

Referenced by llvm::yaml::MappingTraits< FormatStyle >::mapping(), and operator==().

◆ InEmptyParentheses

bool clang::format::FormatStyle::SpacesInParensCustom::InEmptyParentheses

Put a space in parentheses only if the parentheses are empty i.e.

'()'

true: false:
void f( ) { vs. void f() {
int x[] = {foo( ), bar( )}; int x[] = {foo(), bar()};
if (true) { if (true) {
f( ); f();
} }
} }

Definition at line 4643 of file Format.h.

Referenced by llvm::yaml::MappingTraits< FormatStyle >::mapping(), and operator==().

◆ Other

bool clang::format::FormatStyle::SpacesInParensCustom::Other

Put a space in parentheses not covered by preceding options.

true: false:
t f( Deleted & ) & = delete; vs. t f(Deleted &) & = delete;

Definition at line 4649 of file Format.h.

Referenced by clang::format::BreakableStringLiteralUsingOperators::BreakableStringLiteralUsingOperators(), llvm::yaml::MappingTraits< FormatStyle >::mapping(), and operator==().


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