Skip to content

Interval Tree Customization #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading