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

Alignment options. More...

#include "clang/Format/Format.h"

Public Member Functions

bool operator== (const ShortCaseStatementsAlignmentStyle &R) const
 

Public Attributes

bool Enabled
 Whether aligning is enabled.
 
bool AcrossEmptyLines
 Whether to align across empty lines.
 
bool AcrossComments
 Whether to align across comments.
 
bool AlignCaseArrows
 Whether to align the case arrows when aligning short case expressions.
 
bool AlignCaseColons
 Whether aligned case labels are aligned on the colon, or on the tokens after the colon.
 

Detailed Description

Alignment options.

Definition at line 322 of file Format.h.

Member Function Documentation

◆ operator==()

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

Definition at line 413 of file Format.h.

References AcrossComments, AcrossEmptyLines, AlignCaseArrows, AlignCaseColons, and Enabled.

Member Data Documentation

◆ AcrossComments

bool clang::format::FormatStyle::ShortCaseStatementsAlignmentStyle::AcrossComments

Whether to align across comments.

true:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
/* A comment. */
default: return "";
}
false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
/* A comment. */
default: return "";
}

Definition at line 377 of file Format.h.

Referenced by operator==().

◆ AcrossEmptyLines

bool clang::format::FormatStyle::ShortCaseStatementsAlignmentStyle::AcrossEmptyLines

Whether to align across empty lines.

true:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}
false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}

Definition at line 358 of file Format.h.

Referenced by operator==().

◆ AlignCaseArrows

bool clang::format::FormatStyle::ShortCaseStatementsAlignmentStyle::AlignCaseArrows

Whether to align the case arrows when aligning short case expressions.

true:
i = switch (day) {
case THURSDAY, SATURDAY -> 8;
case WEDNESDAY -> 9;
default -> 0;
};
false:
i = switch (day) {
case THURSDAY, SATURDAY -> 8;
case WEDNESDAY -> 9;
default -> 0;
};

Definition at line 394 of file Format.h.

Referenced by operator==().

◆ AlignCaseColons

bool clang::format::FormatStyle::ShortCaseStatementsAlignmentStyle::AlignCaseColons

Whether aligned case labels are aligned on the colon, or on the tokens after the colon.

true:
switch (level) {
case log::info : return "info:";
case log::warning: return "warning:";
default : return "";
}
false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}

Definition at line 412 of file Format.h.

Referenced by operator==().

◆ Enabled

bool clang::format::FormatStyle::ShortCaseStatementsAlignmentStyle::Enabled

Whether aligning is enabled.

true:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}
false:
switch (level) {
case log::info: return "info:";
case log::warning: return "warning:";
default: return "";
}

Definition at line 339 of file Format.h.

Referenced by operator==().


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