clang 24.0.0git
FormatStyle::TrailingCommentsAlignmentStyle Struct Reference

Alignment options. More...

#include "clang/Format/Format.h"

Public Member Functions

bool operator== (const TrailingCommentsAlignmentStyle &R) const
bool operator!= (const TrailingCommentsAlignmentStyle &R) const

Public Attributes

TrailingCommentsAlignmentKinds Kind
 Specifies the way to align trailing comments.
unsigned OverEmptyLines
 How many empty lines to apply alignment.
bool AlignPPAndNotPP
 If comments following preprocessor directive should be aligned with comments that don't.

Detailed Description

Alignment options.

Definition at line 588 of file Format.h.

Member Function Documentation

◆ operator!=()

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

Definition at line 628 of file Format.h.

◆ operator==()

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

Definition at line 624 of file Format.h.

Member Data Documentation

◆ AlignPPAndNotPP

bool clang::format::FormatStyle::TrailingCommentsAlignmentStyle::AlignPPAndNotPP

If comments following preprocessor directive should be aligned with comments that don't.

true: false:
#define A // Comment vs. #define A // Comment
#define AB // Aligned #define AB // Aligned
int i; // Aligned int i; // Not aligned

Definition at line 622 of file Format.h.

◆ Kind

TrailingCommentsAlignmentKinds clang::format::FormatStyle::TrailingCommentsAlignmentStyle::Kind

Specifies the way to align trailing comments.

Definition at line 590 of file Format.h.

◆ OverEmptyLines

unsigned clang::format::FormatStyle::TrailingCommentsAlignmentStyle::OverEmptyLines

How many empty lines to apply alignment.

When both MaxEmptyLinesToKeep and OverEmptyLines are set to 2, it formats like below.

int a; // all these
int ab; // comments are
int abcdef; // aligned

When MaxEmptyLinesToKeep is set to 2 and OverEmptyLines is set to 1, it formats like below.

int a; // these are
int ab; // aligned
int abcdef; // but this isn't

Definition at line 613 of file Format.h.


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