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

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

#include "clang/Format/Format.h"

Public Member Functions

 SpaceBeforeParensCustom ()
 
bool operator== (const SpaceBeforeParensCustom &Other) const
 

Public Attributes

bool AfterControlStatements
 If true, put space between control statement keywords (for/if/while...) and opening parentheses.
 
bool AfterForeachMacros
 If true, put space between foreach macros and opening parentheses.
 
bool AfterFunctionDeclarationName
 If true, put a space between function declaration name and opening parentheses.
 
bool AfterFunctionDefinitionName
 If true, put a space between function definition name and opening parentheses.
 
bool AfterIfMacros
 If true, put space between if macros and opening parentheses.
 
bool AfterOverloadedOperator
 If true, put a space between operator overloading and opening parentheses.
 
bool AfterPlacementOperator
 If true, put a space between operator new/delete and opening parenthesis.
 
bool AfterRequiresInClause
 If true, put space between requires keyword in a requires clause and opening parentheses, if there is one.
 
bool AfterRequiresInExpression
 If true, put space between requires keyword in a requires expression and opening parentheses.
 
bool BeforeNonEmptyParentheses
 If true, put a space before opening parentheses only if the parentheses are not empty.
 

Detailed Description

Precise control over the spacing before parentheses.

# Should be declared this way:
bool AfterControlStatements
If true, put space between control statement keywords (for/if/while...) and opening parentheses.
Definition: Format.h:4327
bool AfterFunctionDefinitionName
If true, put a space between function definition name and opening parentheses.
Definition: Format.h:4348
SpaceBeforeParensCustom SpaceBeforeParensOptions
Control of individual space before parentheses.
Definition: Format.h:4436
SpaceBeforeParensStyle SpaceBeforeParens
Defines in which cases to put a space before opening parentheses.
Definition: Format.h:4310

Definition at line 4320 of file Format.h.

Constructor & Destructor Documentation

◆ SpaceBeforeParensCustom()

clang::format::FormatStyle::SpaceBeforeParensCustom::SpaceBeforeParensCustom ( )
inline

Definition at line 4400 of file Format.h.

Member Function Documentation

◆ operator==()

bool clang::format::FormatStyle::SpaceBeforeParensCustom::operator== ( const SpaceBeforeParensCustom Other) const
inline

Member Data Documentation

◆ AfterControlStatements

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterControlStatements

If true, put space between control statement keywords (for/if/while...) and opening parentheses.

true: false:
if (...) {} vs. if(...) {}

Definition at line 4327 of file Format.h.

Referenced by clang::format::expandPresetsSpaceBeforeParens(), clang::format::getLLVMStyle(), and operator==().

◆ AfterForeachMacros

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterForeachMacros

If true, put space between foreach macros and opening parentheses.

true: false:
FOREACH (...) vs. FOREACH(...)
<loop-body> <loop-body>

Definition at line 4334 of file Format.h.

Referenced by clang::format::expandPresetsSpaceBeforeParens(), clang::format::getLLVMStyle(), and operator==().

◆ AfterFunctionDeclarationName

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterFunctionDeclarationName

If true, put a space between function declaration name and opening parentheses.

true: false:
void f (); vs. void f();

Definition at line 4341 of file Format.h.

Referenced by operator==().

◆ AfterFunctionDefinitionName

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterFunctionDefinitionName

If true, put a space between function definition name and opening parentheses.

true: false:
void f () {} vs. void f() {}

Definition at line 4348 of file Format.h.

Referenced by operator==().

◆ AfterIfMacros

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterIfMacros

If true, put space between if macros and opening parentheses.

true: false:
IF (...) vs. IF(...)
<conditional-body> <conditional-body>

Definition at line 4355 of file Format.h.

Referenced by clang::format::expandPresetsSpaceBeforeParens(), clang::format::getLLVMStyle(), and operator==().

◆ AfterOverloadedOperator

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterOverloadedOperator

If true, put a space between operator overloading and opening parentheses.

true: false:
void operator++ (int a); vs. void operator++(int a);
object.operator++ (10); object.operator++(10);

Definition at line 4363 of file Format.h.

Referenced by operator==().

◆ AfterPlacementOperator

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterPlacementOperator

If true, put a space between operator new/delete and opening parenthesis.

true: false:
new (buf) T; vs. new(buf) T;
delete (buf) T; delete(buf) T;
const FunctionProtoType * T

Definition at line 4371 of file Format.h.

Referenced by clang::format::expandPresetsSpaceBeforeParens(), and operator==().

◆ AfterRequiresInClause

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterRequiresInClause

If true, put space between requires keyword in a requires clause and opening parentheses, if there is one.

true: false:
template<typename T> vs. template<typename T>
requires (A<T> && B<T>) requires(A<T> && B<T>)
... ...

Definition at line 4380 of file Format.h.

Referenced by operator==().

◆ AfterRequiresInExpression

bool clang::format::FormatStyle::SpaceBeforeParensCustom::AfterRequiresInExpression

If true, put space between requires keyword in a requires expression and opening parentheses.

true: false:
template<typename T> vs. template<typename T>
concept C = requires (T t) { concept C = requires(T t) {
... ...
} }

Definition at line 4390 of file Format.h.

Referenced by operator==().

◆ BeforeNonEmptyParentheses

bool clang::format::FormatStyle::SpaceBeforeParensCustom::BeforeNonEmptyParentheses

If true, put a space before opening parentheses only if the parentheses are not empty.

true: false:
void f (int a); vs. void f();
f (a); f();

Definition at line 4398 of file Format.h.

Referenced by clang::format::expandPresetsSpaceBeforeParens(), and operator==().


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