diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3936aff..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,286 +0,0 @@ -{ - "editor.tabSize": 4, - "editor.rulers": [ - 120 - ], - "editor.renderWhitespace": "trailing", - "editor.suggestSelection": "first", - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.stickyScroll.enabled": false, - "editor.bracketPairColorization.enabled": false, - "editor.cursorSmoothCaretAnimation": "on", - "editor.suggest.preview": true, - "terminal.integrated.defaultProfile.windows": "Command Prompt", - "debug.onTaskErrors": "debugAnyway", - "explorer.compactFolders": false, - "explorer.confirmDragAndDrop": false, - "explorer.confirmDelete": false, - "explorer.copyRelativePathSeparator": "/", - "files.autoSave": "onFocusChange", - "files.exclude": { - "node_modules/**/*": true, - "**/.classpath": true, - "**/.project": true, - "**/.settings": true, - "**/.factorypath": true - }, - "files.associations": { - ".clang*": "yaml", - "*.hpp.in": "cpp", - "*.in": "cpp", - "iostream": "cpp", - "filesystem": "cpp", - "__bit_reference": "cpp", - "__config": "cpp", - "__debug": "cpp", - "__errc": "cpp", - "__hash_table": "cpp", - "__locale": "cpp", - "__mutex_base": "cpp", - "__node_handle": "cpp", - "__split_buffer": "cpp", - "__std_stream": "cpp", - "__threading_support": "cpp", - "__tree": "cpp", - "__verbose_abort": "cpp", - "array": "cpp", - "atomic": "cpp", - "bitset": "cpp", - "cctype": "cpp", - "charconv": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "complex": "cpp", - "condition_variable": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "deque": "cpp", - "exception": "cpp", - "fstream": "cpp", - "future": "cpp", - "initializer_list": "cpp", - "iomanip": "cpp", - "ios": "cpp", - "iosfwd": "cpp", - "istream": "cpp", - "limits": "cpp", - "locale": "cpp", - "map": "cpp", - "mutex": "cpp", - "new": "cpp", - "optional": "cpp", - "ostream": "cpp", - "queue": "cpp", - "ratio": "cpp", - "regex": "cpp", - "set": "cpp", - "span": "cpp", - "sstream": "cpp", - "stack": "cpp", - "stdexcept": "cpp", - "streambuf": "cpp", - "string": "cpp", - "string_view": "cpp", - "system_error": "cpp", - "thread": "cpp", - "tuple": "cpp", - "typeinfo": "cpp", - "unordered_map": "cpp", - "variant": "cpp", - "vector": "cpp", - "algorithm": "cpp" - }, - "files.insertFinalNewline": true, - "files.trimFinalNewlines": true, - "files.trimTrailingWhitespace": true, - "workbench.startupEditor": "none", - "workbench.editorAssociations": { - "*.md": "vscode.markdown.preview.editor", - "*.svg": "svgPreviewer.customEditor" - }, - "workbench.colorTheme": "Default Dark+", - "git.enableSmartCommit": true, - "git.autofetch": true, - "git.confirmSync": false, - "git.openRepositoryInParentFolders": "always", - "prettier.tabWidth": 4, - "prettier.singleQuote": true, - "prettier.jsxSingleQuote": true, - "prettier.trailingComma": "all", - "prettier.useEditorConfig": true, - "prettier.bracketSpacing": false, - "markdown.validate.enabled": true, - "[markdown]": { - "files.trimTrailingWhitespace": false, - "editor.formatOnSave": false, - "editor.defaultFormatter": "yzhang.markdown-all-in-one", - "editor.wordWrap": "wordWrapColumn", - "editor.wordWrapColumn": 120 - }, - "[yaml]": { - "editor.formatOnSave": false, - "editor.defaultFormatter": "redhat.vscode-yaml", - "editor.wordWrap": "wordWrapColumn", - "editor.wordWrapColumn": 120 - }, - "[json]": { - "editor.formatOnSave": false, - "editor.defaultFormatter": "vscode.json-language-features" - }, - "[jsonc]": { - "editor.formatOnSave": false - }, - "[plaintext]": { - "editor.wordWrap": "wordWrapColumn", - "editor.wordWrapColumn": 120 - }, - "[toml]": { - "editor.wordWrap": "wordWrapColumn", - "editor.wordWrapColumn": 120 - }, - "better-comments.tags": [ - { - "tag": "XXX", - "color": "#F8C471" - }, - { - "tag": "WARN", - "color": "#FF6961" - }, - { - "tag": "NOTE", - "color": "#3498DB" - }, - { - "tag": "TODO", - "color": "#77C3EC" - } - ], - "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", - "codesnap.showWindowControls": false, - "codesnap.shutterAction": "copy", - "Workspace_Formatter.excludePattern": [ - "**/build", - "**/.*", - "**/.vscode", - "**/html" - ], - "Workspace_Formatter.includePattern": [ - "*.c", - "*.h", - "*.cc", - "*.hh", - "*.cpp", - "*.hpp" - ], - "svg.preview.autoOpen": true, - "remote.WSL.fileWatcher.polling": true, - "errorLens.delay": 1000, - "errorLens.enabledDiagnosticLevels": [ - "error", - "warning" - ], - "errorLens.enabled": false, - "C_Cpp.clang_format_sortIncludes": true, - "C_Cpp.vcFormat.indent.preserveComments": true, - "C_Cpp.vcFormat.indent.namespaceContents": false, - "C_Cpp.vcFormat.indent.caseContentsWhenBlock": true, - "C_Cpp.vcFormat.space.pointerReferenceAlignment": "right", - "C_Cpp.default.browse.limitSymbolsToIncludedHeaders": false, - "C_Cpp.default.cppStandard": "c++20", - "C_Cpp.default.cStandard": "c11", - "C_Cpp.formatting": "clangFormat", - "[c]": { - "editor.formatOnSave": false, - "editor.defaultFormatter": "ms-vscode.cpptools" - }, - "[cpp]": { - "editor.formatOnSave": false, - "editor.defaultFormatter": "ms-vscode.cpptools" - }, - "[cuda-cpp]": { - "editor.defaultFormatter": "ms-vscode.cpptools" - }, - "cmake.configureOnOpen": false, - "cmake.autoSelectActiveFolder": false, - "cmake.configureOnEdit": false, - "[cmake]": { - "editor.formatOnSave": false, - "editor.defaultFormatter": "cheshirekow.cmake-format" - }, - "cmake.options.statusBarVisibility": "visible", - "doxdocgen.file.fileTemplate": "@file {name}", - "doxdocgen.cpp.tparamTemplate": "@tparam {param} ", - "doxdocgen.generic.briefTemplate": "@brief {text}", - "doxdocgen.generic.boolReturnsTrueFalse": false, - "doxdocgen.generic.paramTemplate": "@param {param} ", - "doxdocgen.generic.returnTemplate": "@return", - "doxdocgen.generic.includeTypeAtReturn": false, - "C_Cpp.codeAnalysis.clangTidy.enabled": false, - "C_Cpp.configurationWarnings": "disabled", - "C_Cpp_Runner.cppStandard": "c++20", - "C_Cpp_Runner.cStandard": "c11", - "C_Cpp_Runner.enableWarnings": true, - "C_Cpp_Runner.warningsAsError": false, - "C_Cpp_Runner.cCompilerPath": "gcc", - "C_Cpp_Runner.cppCompilerPath": "g++", - "C_Cpp_Runner.debuggerPath": "gdb", - "C_Cpp_Runner.useMsvc": false, - "C_Cpp_Runner.warnings": [ - "-Wall", - "-Wextra", - "-Wpedantic", - "-Wshadow", - "-Wformat=2", - "-Wcast-align", - "-Wconversion", - "-Wsign-conversion", - "-Wnull-dereference" - ], - "C_Cpp_Runner.msvcWarnings": [ - "/W4", - "/permissive-", - "/w14242", - "/w14287", - "/w14296", - "/w14311", - "/w14826", - "/w44062", - "/w44242", - "/w14905", - "/w14906", - "/w14263", - "/w44265", - "/w14928" - ], - "C_Cpp_Runner.compilerArgs": [], - "C_Cpp_Runner.linkerArgs": [], - "C_Cpp_Runner.includePaths": [], - "C_Cpp_Runner.includeSearch": [ - "*", - "**/*" - ], - "C_Cpp_Runner.excludeSearch": [ - "**/build", - "**/build/**", - "**/.*", - "**/.*/**", - "**/.vscode", - "**/.vscode/**" - ], - "C_Cpp_Runner.useAddressSanitizer": false, - "C_Cpp_Runner.useUndefinedSanitizer": false, - "C_Cpp_Runner.useLeakSanitizer": false, - "C_Cpp_Runner.showCompilationTime": false, - "C_Cpp_Runner.useLinkTimeOptimization": false, - "C_Cpp_Runner.msvcSecureNoWarnings": false, - "C_Cpp_Runner.msvcBatchPath": "" -} diff --git a/CMakeLists.txt b/CMakeLists.txt index 217d0a1..b7a4e21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,7 +119,7 @@ if(NOT DEFINED IGNORELIBS) # Ignoro las librerias para subir la doc a github pa # Dejo un par como ejemplo. Comentar o descomentar o añadir... cpmaddpackage("gh:gabime/spdlog@1.11.0") cpmaddpackage("gh:catchorg/Catch2@2.13.9") - #cpmaddpackage("gh:fmtlib/fmt#9.1.0") + cpmaddpackage("gh:fmtlib/fmt#9.1.0") #cpmaddpackage("gh:nlohmann/json@3.11.2") #cpmaddpackage("gh:jarro2783/cxxopts@3.1.1") endif() diff --git a/app/parchiscmd.cpp b/app/parchiscmd.cpp index e29a6ca..47b1b07 100644 --- a/app/parchiscmd.cpp +++ b/app/parchiscmd.cpp @@ -122,7 +122,8 @@ int main(int argc, char **argv) { std::cout - << "Parchis, engine v" << pVersion->getVersion() << std::endl + << "Parchis, engine v" << pVersion->getVersionFull() + << std::endl << std::endl << "Uso: " << project_name << std::endl << " -h, --help print this help and exit" @@ -140,7 +141,7 @@ int main(int argc, char **argv) if (showVersion) { // std::cout << std::endl << "Parchis v" << version << std::endl; - std::cout << "Parchis, engine v" << pVersion->getVersion() + std::cout << "Parchis, engine v" << pVersion->getVersionFull() << std::endl << std::endl; } diff --git a/configured/CMakeLists.txt b/configured/CMakeLists 2.txt similarity index 100% rename from configured/CMakeLists.txt rename to configured/CMakeLists 2.txt diff --git a/src/libparchis/CMakeLists.txt b/src/libparchis/CMakeLists.txt index a850e7e..a366cec 100644 --- a/src/libparchis/CMakeLists.txt +++ b/src/libparchis/CMakeLists.txt @@ -62,8 +62,8 @@ if(NOT DEFINED IGNORELIBS) # Ignoro las librerias para subir la doc a github pa # revisa la sección del gestor de paquetes. #nlohmann_json::nlohmann_json - #fmt::fmt #cxxopts::cxxopts + fmt::fmt spdlog::spdlog) endif() diff --git a/src/libparchis/PParchis.cpp b/src/libparchis/PParchis.cpp index 1d008db..6882a28 100644 --- a/src/libparchis/PParchis.cpp +++ b/src/libparchis/PParchis.cpp @@ -11,6 +11,9 @@ //--------------------------------------------------------------------------- #include "PParchis.h" +// Librerías externas +#include +#include //--------------------------------------------------------------------------- @@ -31,16 +34,19 @@ void PParchis::initAttributes() board = new PBoard("Tablero"); // Instantiate the Board (and Game) // Get the version number - svnVersion = new PVersion(); + PVersion *pVersion = new PVersion(); + const auto versionTitle = + fmt::format("| version: {:<20} |", + pVersion->getVersionFull()); // Debug purposes dbg.setCallerName("Parchis"); dbg.print(1, "+========================================================+"); dbg.print(1, "| PParchis init |"); - dbg.printF(1, - "| version: %-20s |", - this->getVersion()); + dbg.print(1, versionTitle); dbg.print(1, "+========================================================+"); + + delete pVersion; } //--------------------------------------------------------------------------- @@ -72,7 +78,6 @@ PParchis::~PParchis() { dbg.print(4, "+========================================================+"); dbg.print(4, "| PParchis DESTRUCTOR |"); - delete svnVersion; delete board; dbg.print(4, "+===============Fin Destructor PParchis==================+"); dbg.print(4, "| |"); @@ -85,15 +90,6 @@ PParchis::~PParchis() //--------------------------------------------------------------------------- -/** - * Getter: Returns the version of Parchis Engine - * @return Pointer to char* with the version of the parchis engine - */ -const char *PParchis::getVersion() -{ - return svnVersion->getVersion(); -} - //--------------------------------------------------------------------------- diff --git a/src/libparchis/PParchis.h b/src/libparchis/PParchis.h index 7c6d78b..f67578e 100644 --- a/src/libparchis/PParchis.h +++ b/src/libparchis/PParchis.h @@ -220,9 +220,7 @@ class PParchis // PRIVATE ATTRIBUTES (For ivar's use comments for doxygen: //!<) - bool bGameActive; //!< Indicates if (true/false) the game is active - PVersion *svnVersion; //!< Version number - + bool bGameActive; //!< Indicates if (true/false) the game is active #pragma mark ====== PRIVATE INSTANCE METHODS @@ -249,8 +247,6 @@ class PParchis // STATIC PUBLIC METHODS - const char *getVersion(); // Get parchis Version - // PUBLIC METHODS diff --git a/src/libparchis/PVersion.cpp b/src/libparchis/PVersion.cpp index 8b584fd..3ee53b9 100644 --- a/src/libparchis/PVersion.cpp +++ b/src/libparchis/PVersion.cpp @@ -27,8 +27,6 @@ */ PVersion::PVersion() { - version = "1.0.2-231-g94d9edb"; - // Crear una expresión regular para validar el formato std::regex versionRegex("^v(\\d+)\\.(\\d+)\\.(\\d+)$"); std::smatch matches; @@ -55,16 +53,6 @@ PVersion::~PVersion() //--------------------------------------------------------------------------- -/** - * Getter: Return the version of Parchis Engine - * - * @return the version of parchis engine - */ -const char *PVersion::getVersion() -{ - return version; -} - /** * Getter: Return the Full git version of Parchis Engine * Value of this command when library was compiled diff --git a/src/libparchis/PVersion.h b/src/libparchis/PVersion.h index 9394e31..ed0992a 100644 --- a/src/libparchis/PVersion.h +++ b/src/libparchis/PVersion.h @@ -169,7 +169,6 @@ class PVersion // STATIC PRIVATE ATTRIBUTES (For ivar's use comments for doxygen: //!<) - const char *version; //!< Version number std::string version_full = GITVERSION_FULL; //!< Version number (git describe --tags --long) v1.2.33-0-g3ad9785 std::string version_tag = @@ -191,7 +190,6 @@ class PVersion virtual ~PVersion(); // Destructor // Getter - const char *getVersion(); std::string getVersionFull(); std::string getVersionTag(); std::string getVersionCommit();