clang 24.0.0git
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 327 of file Format.h.

Member Function Documentation

◆ operator==()

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

Definition at line 418 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 382 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 363 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 399 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 417 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 344 of file Format.h.

Referenced by operator==().


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