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

Options regarding which empty lines are kept. More...

#include "clang/Format/Format.h"

Public Member Functions

bool operator== (const KeepEmptyLinesStyle &R) const

Public Attributes

bool AtEndOfBlock
 Keep empty lines at end of a block.
bool AtEndOfFile
 Keep empty lines at end of file.
bool AtStartOfBlock
 Keep empty lines at start of a block.
bool AtStartOfFile
 Keep empty lines at start of file.

Detailed Description

Options regarding which empty lines are kept.

For example, the config below will remove empty lines at start of the file, end of the file, and start of blocks.

AtEndOfBlock: false
AtEndOfFile: false
bool AtStartOfFile
Keep empty lines at start of file.
Definition Format.h:3791
bool AtEndOfBlock
Keep empty lines at end of a block.
Definition Format.h:3778
bool AtEndOfFile
Keep empty lines at end of file.
Definition Format.h:3780
bool AtStartOfBlock
Keep empty lines at start of a block.
Definition Format.h:3789
KeepEmptyLinesStyle KeepEmptyLines
Which empty lines are kept.
Definition Format.h:3801

Definition at line 3769 of file Format.h.

Member Function Documentation

◆ operator==()

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

Definition at line 3792 of file Format.h.

References AtEndOfBlock, AtEndOfFile, AtStartOfBlock, and AtStartOfFile.

Member Data Documentation

◆ AtEndOfBlock

bool clang::format::FormatStyle::KeepEmptyLinesStyle::AtEndOfBlock

Keep empty lines at end of a block.

true: false:
if (foo) { vs. if (foo) {
bar(); bar();
}
}

Definition at line 3778 of file Format.h.

Referenced by operator==().

◆ AtEndOfFile

bool clang::format::FormatStyle::KeepEmptyLinesStyle::AtEndOfFile

Keep empty lines at end of file.

Definition at line 3780 of file Format.h.

Referenced by operator==().

◆ AtStartOfBlock

bool clang::format::FormatStyle::KeepEmptyLinesStyle::AtStartOfBlock

Keep empty lines at start of a block.

true: false:
if (foo) { vs. if (foo) {
bar();
bar(); }
}

Definition at line 3789 of file Format.h.

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

◆ AtStartOfFile

bool clang::format::FormatStyle::KeepEmptyLinesStyle::AtStartOfFile

Keep empty lines at start of file.

Definition at line 3791 of file Format.h.

Referenced by operator==().


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