Skip to content

Commit 4642367

Browse files
authored
Merge pull request #29 from 5cript/feat/advanced-customization
Interval Tree Customization
2 parents 7817451 + 407acf6 commit 4642367

11 files changed

+590
-153
lines changed

.clang-format

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
AlignAfterOpenBracket: BlockIndent
2+
#AlignAfterOpenBracket: AlwaysBreak
3+
AlignEscapedNewlines: DontAlign
4+
AlignTrailingComments: false
5+
AllowAllArgumentsOnNextLine: true
6+
AllowAllConstructorInitializersOnNextLine: false
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortBlocksOnASingleLine: Empty
9+
AllowShortCaseLabelsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: None
11+
AllowShortIfStatementsOnASingleLine: Never
12+
AllowShortLambdasOnASingleLine: Empty
13+
AllowShortLoopsOnASingleLine: false
14+
AlwaysBreakBeforeMultilineStrings: true
15+
BasedOnStyle: LLVM
16+
BinPackArguments: false
17+
BinPackParameters: false
18+
BreakBeforeBinaryOperators: None
19+
BreakBeforeTernaryOperators: true
20+
BreakBeforeBraces: Custom
21+
BraceWrapping:
22+
AfterCaseLabel: true
23+
AfterClass: true
24+
AfterControlStatement: Always
25+
AfterEnum: true
26+
AfterFunction: true
27+
AfterNamespace: true
28+
AfterStruct: true
29+
AfterUnion: true
30+
BeforeCatch: true
31+
BeforeElse: true
32+
IndentBraces: false
33+
SplitEmptyFunction: false
34+
SplitEmptyNamespace: true
35+
SplitEmptyRecord: false
36+
AlwaysBreakTemplateDeclarations: true
37+
BreakConstructorInitializers: BeforeComma
38+
BreakBeforeConceptDeclarations: Always
39+
RequiresClausePosition: OwnLine
40+
RequiresExpressionIndentation: OuterScope
41+
BreakInheritanceList: BeforeComma
42+
BreakStringLiterals: true
43+
ColumnLimit: 120
44+
ContinuationIndentWidth: 4
45+
ConstructorInitializerIndentWidth: 4
46+
Cpp11BracedListStyle: true
47+
FixNamespaceComments: false
48+
IncludeBlocks: Preserve
49+
IndentCaseLabels: true
50+
IndentPPDirectives: AfterHash
51+
IndentWidth: 4
52+
Language: Cpp
53+
NamespaceIndentation: All
54+
PointerAlignment: Left
55+
ReflowComments: true
56+
SortIncludes: false
57+
SortUsingDeclarations: false
58+
SpaceAfterTemplateKeyword: true
59+
SpaceBeforeAssignmentOperators: true
60+
SpaceBeforeParens: ControlStatements
61+
SpaceInEmptyParentheses: false
62+
SpacesBeforeTrailingComments: 1
63+
SpacesInAngles: false
64+
SpacesInParentheses: false
65+
SpacesInSquareBrackets: false
66+
Standard: c++20
67+
TabWidth: 4
68+
UseTab: Never
69+
EmptyLineBeforeAccessModifier: Always
70+
IndentExternBlock: Indent
71+
IndentRequires: false
72+
AlignOperands: DontAlign

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ bin
66
*.save-failed
77
__history/
88
*.cbp
9-
main.hpp
10-
main.cpp
119
*.png
1210
.vscode
1311
build

drawings/CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,13 @@ add_executable(interval-tree-drawings "main.cpp")
44

55
target_link_libraries(interval-tree-drawings PRIVATE interval-tree cairo cairo-wrap)
66

7-
set_target_properties(interval-tree-drawings PROPERTIES OUTPUT_NAME "make_drawings")
7+
set_target_properties(interval-tree-drawings PROPERTIES OUTPUT_NAME "make_drawings")
8+
9+
# If msys2, copy dynamic libraries to executable directory, visual studio does this automatically.
10+
# And there is no need on linux.
11+
if (DEFINED ENV{MSYSTEM})
12+
add_custom_command(TARGET interval-tree-drawings POST_BUILD
13+
COMMAND bash -c "ldd $<TARGET_FILE:interval-tree-drawings>" | "grep" "clang" | awk "NF == 4 { system(\"${CMAKE_COMMAND} -E copy \" \$3 \" $<TARGET_FILE_DIR:interval-tree-drawings>\") }"
14+
VERBATIM
15+
)
16+
endif()

drawings/main.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include "example_drawings.hpp"
2+
3+
#if __cplusplus >= 201703L
4+
# include <filesystem>
5+
#endif
6+
7+
int main()
8+
{
9+
#if __cplusplus >= 201703L
10+
if (!std::filesystem::exists("drawings"))
11+
std::filesystem::create_directory("drawings");
12+
#endif
13+
14+
drawAll();
15+
}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
3+
#if defined(__cpp_concepts) && __cpp_concepts >= 202002L
4+
# define LIB_INTERVAL_TREE_CONCEPTS
5+
#endif
6+
7+
namespace lib_interval_tree
8+
{
9+
}

0 commit comments

Comments
 (0)