clang  5.0.0svn
Public Attributes | List of all members
clang::format::FormatStyle::BraceWrappingFlags Struct Reference

Precise control over the wrapping of braces. More...

#include <Format.h>

Collaboration diagram for clang::format::FormatStyle::BraceWrappingFlags:
Collaboration graph
[legend]

Public Attributes

bool AfterClass
 Wrap class definitions. More...
 
bool AfterControlStatement
 Wrap control statements (if/for/while/switch/..). More...
 
bool AfterEnum
 Wrap enum definitions. More...
 
bool AfterFunction
 Wrap function definitions. More...
 
bool AfterNamespace
 Wrap namespace definitions. More...
 
bool AfterObjCDeclaration
 Wrap ObjC definitions (@autoreleasepool, interfaces, ..). More...
 
bool AfterStruct
 Wrap struct definitions. More...
 
bool AfterUnion
 Wrap union definitions. More...
 
bool BeforeCatch
 Wrap before catch. More...
 
bool BeforeElse
 Wrap before else. More...
 
bool IndentBraces
 Indent the wrapped braces themselves. More...
 

Detailed Description

Precise control over the wrapping of braces.

# Should be declared this way:
AfterClass: true

Definition at line 539 of file Format.h.

Member Data Documentation

◆ AfterClass

bool clang::format::FormatStyle::BraceWrappingFlags::AfterClass

Wrap class definitions.

true:
class foo {};
false:
class foo
{};

Definition at line 549 of file Format.h.

Referenced by clang::format::ShouldBreakBeforeBrace().

◆ AfterControlStatement

bool clang::format::FormatStyle::BraceWrappingFlags::AfterControlStatement

Wrap control statements (if/for/while/switch/..).

true:
if (foo())
{
} else
{}
for (int i = 0; i < 10; ++i)
{}
false:
if (foo()) {
} else {
}
for (int i = 0; i < 10; ++i) {
}

Definition at line 567 of file Format.h.

◆ AfterEnum

bool clang::format::FormatStyle::BraceWrappingFlags::AfterEnum

Wrap enum definitions.

true:
enum X : int
{
B
};
false:
enum X : int { B };

Definition at line 579 of file Format.h.

◆ AfterFunction

bool clang::format::FormatStyle::BraceWrappingFlags::AfterFunction

Wrap function definitions.

true:
void foo()
{
bar();
bar2();
}
false:
void foo() {
bar();
bar2();
}

Definition at line 595 of file Format.h.

◆ AfterNamespace

bool clang::format::FormatStyle::BraceWrappingFlags::AfterNamespace

Wrap namespace definitions.

true:
namespace
{
int foo();
int bar();
}
false:
namespace {
int foo();
int bar();
}

Definition at line 611 of file Format.h.

Referenced by clang::format::ShouldBreakBeforeBrace().

◆ AfterObjCDeclaration

bool clang::format::FormatStyle::BraceWrappingFlags::AfterObjCDeclaration

Wrap ObjC definitions (@autoreleasepool, interfaces, ..).

Definition at line 613 of file Format.h.

◆ AfterStruct

bool clang::format::FormatStyle::BraceWrappingFlags::AfterStruct

Wrap struct definitions.

true:
struct foo
{
int x;
}
false:
struct foo {
int x;
}

Definition at line 627 of file Format.h.

Referenced by clang::format::ShouldBreakBeforeBrace().

◆ AfterUnion

bool clang::format::FormatStyle::BraceWrappingFlags::AfterUnion

Wrap union definitions.

true:
union foo
{
int x;
}
false:
union foo {
int x;
}

Definition at line 641 of file Format.h.

Referenced by clang::format::ShouldBreakBeforeBrace().

◆ BeforeCatch

bool clang::format::FormatStyle::BraceWrappingFlags::BeforeCatch

Wrap before catch.

true:
try {
foo();
}
catch () {
}
false:
try {
foo();
} catch () {
}

Definition at line 657 of file Format.h.

◆ BeforeElse

bool clang::format::FormatStyle::BraceWrappingFlags::BeforeElse

Wrap before else.

true:
if (foo()) {
}
else {
}
false:
if (foo()) {
} else {
}

Definition at line 671 of file Format.h.

◆ IndentBraces

bool clang::format::FormatStyle::BraceWrappingFlags::IndentBraces

Indent the wrapped braces themselves.

Definition at line 673 of file Format.h.


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