Skip to content

Commit

Permalink
Merge pull request #29 from 5cript/feat/advanced-customization
Browse files Browse the repository at this point in the history
Interval Tree Customization
  • Loading branch information
5cript authored Jul 28, 2024
2 parents 7817451 + 407acf6 commit 4642367
Show file tree
Hide file tree
Showing 11 changed files with 590 additions and 153 deletions.
72 changes: 72 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
AlignAfterOpenBracket: BlockIndent
#AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: DontAlign
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
BasedOnStyle: LLVM
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: true
SplitEmptyRecord: false
AlwaysBreakTemplateDeclarations: true
BreakConstructorInitializers: BeforeComma
BreakBeforeConceptDeclarations: Always
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
ColumnLimit: 120
ContinuationIndentWidth: 4
ConstructorInitializerIndentWidth: 4
Cpp11BracedListStyle: true
FixNamespaceComments: false
IncludeBlocks: Preserve
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 4
Language: Cpp
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 4
UseTab: Never
EmptyLineBeforeAccessModifier: Always
IndentExternBlock: Indent
IndentRequires: false
AlignOperands: DontAlign
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ bin
*.save-failed
__history/
*.cbp
main.hpp
main.cpp
*.png
.vscode
build
Expand Down
11 changes: 10 additions & 1 deletion drawings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ add_executable(interval-tree-drawings "main.cpp")

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

set_target_properties(interval-tree-drawings PROPERTIES OUTPUT_NAME "make_drawings")
set_target_properties(interval-tree-drawings PROPERTIES OUTPUT_NAME "make_drawings")

# If msys2, copy dynamic libraries to executable directory, visual studio does this automatically.
# And there is no need on linux.
if (DEFINED ENV{MSYSTEM})
add_custom_command(TARGET interval-tree-drawings POST_BUILD
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>\") }"
VERBATIM
)
endif()
15 changes: 15 additions & 0 deletions drawings/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "example_drawings.hpp"

#if __cplusplus >= 201703L
# include <filesystem>
#endif

int main()
{
#if __cplusplus >= 201703L
if (!std::filesystem::exists("drawings"))
std::filesystem::create_directory("drawings");
#endif

drawAll();
}
9 changes: 9 additions & 0 deletions include/interval-tree/feature_test.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#if defined(__cpp_concepts) && __cpp_concepts >= 202002L
# define LIB_INTERVAL_TREE_CONCEPTS
#endif

namespace lib_interval_tree
{
}
Loading

0 comments on commit 4642367

Please sign in to comment.