clang 24.0.0git
clang::format::FormatStyle::BreakBinaryOperationsOptions Struct Reference

Options for BreakBinaryOperations. More...

#include "clang/Format/Format.h"

Public Member Functions

const BinaryOperationBreakRulefindRuleForOperator (tok::TokenKind Kind) const
BreakBinaryOperationsStyle getStyleForOperator (tok::TokenKind Kind) const
unsigned getMinChainLengthForOperator (tok::TokenKind Kind) const
bool operator== (const BreakBinaryOperationsOptions &R) const
bool operator!= (const BreakBinaryOperationsOptions &R) const

Public Attributes

BreakBinaryOperationsStyle Default
 The default break style for operators not covered by PerOperator.
std::vector< BinaryOperationBreakRulePerOperator
 Per-operator override rules.

Detailed Description

Options for BreakBinaryOperations.

If specified as a simple string (e.g. OnePerLine), it behaves like the original enum and applies to all binary operators.

If specified as a struct, allows per-operator configuration:

BreakBinaryOperations:
Default: Never
PerOperator:
- Operators: ['&&', '||']
Style: OnePerLine
MinChainLength: 3
Version
23

Definition at line 2599 of file Format.h.

Member Function Documentation

◆ findRuleForOperator()

const BinaryOperationBreakRule * clang::format::FormatStyle::BreakBinaryOperationsOptions::findRuleForOperator ( tok::TokenKind Kind) const
inline

Definition at line 2605 of file Format.h.

References PerOperator.

Referenced by getMinChainLengthForOperator(), and getStyleForOperator().

◆ getMinChainLengthForOperator()

unsigned clang::format::FormatStyle::BreakBinaryOperationsOptions::getMinChainLengthForOperator ( tok::TokenKind Kind) const
inline

Definition at line 2625 of file Format.h.

References findRuleForOperator().

◆ getStyleForOperator()

BreakBinaryOperationsStyle clang::format::FormatStyle::BreakBinaryOperationsOptions::getStyleForOperator ( tok::TokenKind Kind) const
inline

Definition at line 2620 of file Format.h.

References Default, and findRuleForOperator().

◆ operator!=()

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

Definition at line 2633 of file Format.h.

◆ operator==()

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

Definition at line 2630 of file Format.h.

References Default, and PerOperator.

Member Data Documentation

◆ Default

BreakBinaryOperationsStyle clang::format::FormatStyle::BreakBinaryOperationsOptions::Default

The default break style for operators not covered by PerOperator.

Definition at line 2601 of file Format.h.

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

◆ PerOperator

std::vector<BinaryOperationBreakRule> clang::format::FormatStyle::BreakBinaryOperationsOptions::PerOperator

Per-operator override rules.

Definition at line 2603 of file Format.h.

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


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