diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 3fa41ba..0000000 --- a/.clang-format +++ /dev/null @@ -1,115 +0,0 @@ ---- -Language: Cpp -# BasedOnStyle: LLVM -AccessModifierOffset: -2 -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false -AlignEscapedNewlines: Right -AlignOperands: true -AlignTrailingComments: true -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false -BinPackArguments: true -BinPackParameters: true -BraceWrapping: - AfterClass: true - AfterControlStatement: false - AfterEnum: false - AfterFunction: false - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: false - AfterUnion: false - AfterExternBlock: false - BeforeCatch: false - BeforeElse: false - IndentBraces: false - SplitEmptyFunction: true - SplitEmptyRecord: true - SplitEmptyNamespace: true -BreakBeforeBinaryOperators: None -BreakBeforeBraces: Linux -BreakBeforeInheritanceComma: false -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: false -BreakConstructorInitializers: BeforeColon -BreakAfterJavaFieldAnnotations: false -BreakStringLiterals: true -ColumnLimit: 100 -CommentPragmas: '^ IWYU pragma:' -CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false -ConstructorInitializerIndentWidth: 4 -ContinuationIndentWidth: 4 -Cpp11BracedListStyle: true -DerivePointerAlignment: false -DisableFormat: false -ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: true -ForEachMacros: - - foreach - - Q_FOREACH - - BOOST_FOREACH -IncludeBlocks: Preserve -IncludeCategories: - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Priority: 2 - - Regex: '^(<|"(gtest|gmock|isl|json)/)' - Priority: 3 - - Regex: '.*' - Priority: 1 -IncludeIsMainRegex: '(Test)?$' -IndentCaseLabels: false -IndentPPDirectives: None -IndentWidth: 4 -IndentWrappedFunctionNames: false -JavaScriptQuotes: Leave -JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true -MacroBlockBegin: '' -MacroBlockEnd: '' -MaxEmptyLinesToKeep: 1 -NamespaceIndentation: None -ObjCBlockIndentWidth: 2 -ObjCSpaceAfterProperty: false -ObjCSpaceBeforeProtocolList: true -PenaltyBreakAssignment: 2 -PenaltyBreakBeforeFirstCallParameter: 19 -PenaltyBreakComment: 300 -PenaltyBreakFirstLessLess: 120 -PenaltyBreakString: 1000 -PenaltyExcessCharacter: 1000000 -PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Left -RawStringFormats: - - Delimiter: pb - Language: TextProto - BasedOnStyle: google -ReflowComments: true -SortIncludes: true -SortUsingDeclarations: true -SpaceAfterCStyleCast: false -SpaceAfterTemplateKeyword: true -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: false -SpacesInContainerLiterals: true -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -SpacesInSquareBrackets: false -Standard: Cpp11 -TabWidth: 8 -UseTab: Never -... - diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 17dfcc6..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - // Verwendet IntelliSense zum Ermitteln möglicher Attribute. - // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen. - // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "(gdb) Launch", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/build/bin/kima2", - "args": [], - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "externalConsole": true, - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - } - ] -} \ No newline at end of file diff --git a/src/core/database.cpp b/src/core/database.cpp index 1ad5f43..b017565 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -5,17 +5,20 @@ Database::Database(const std::string& dbname) : db(nullptr) { const int errCode = sqlite3_open(dbname.c_str(), &db); - if (errCode) { + if(errCode) { throw std::runtime_error("Could not open database file."); } } -Database::~Database() { sqlite3_close(db); } +Database::~Database() +{ + sqlite3_close(db); +} void Database::exec(const std::string& sql) { const int errCode = sqlite3_exec(db, sql.c_str(), nullptr, nullptr, nullptr); - if (errCode) { + if(errCode) { throw std::runtime_error("Error in SQL execution."); } } \ No newline at end of file diff --git a/src/core/entity.cpp b/src/core/entity.cpp index ac48025..4c9ece5 100644 --- a/src/core/entity.cpp +++ b/src/core/entity.cpp @@ -1,20 +1,7 @@ #include "entity.h" -#include - #include -#include -Entity::Entity() {} - -void Entity::createUuid() +Entity::Entity() : uuid(boost::uuids::random_generator()()) { - static boost::uuids::random_generator generator{}; - uuid = generator(); -} - -void Entity::createUuidFromString(const std::string& uuid_string) -{ - boost::uuids::string_generator generator{}; - uuid = generator(uuid_string); } \ No newline at end of file diff --git a/src/core/entity.h b/src/core/entity.h index b36d9a3..e7afcbe 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -7,15 +7,12 @@ class Entity { - public: +public: Entity(); - virtual ~Entity() = 0; - const boost::uuids::uuid& getUuid() { return uuid; }; - void createUuid(); - void createUuidFromString(const std::string& uuid_string); - - private: - boost::uuids::uuid uuid{}; + ~Entity(); + const boost::uuids::uuid& getUuid() {return uuid;}; +private: + boost::uuids::uuid uuid; }; -#endif // ENTITY_H \ No newline at end of file +#endif //ENTITY_H \ No newline at end of file diff --git a/src/gui/kima2.cpp b/src/gui/kima2.cpp index 78ae9c1..bc69ee4 100644 --- a/src/gui/kima2.cpp +++ b/src/gui/kima2.cpp @@ -1,10 +1,7 @@ -#include "../core/entity.h" -#include -#include int main() { - + /* code */ return 0; }