diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d05c1b..17be383 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,7 @@ CPMAddPackage(NAME IOCore #GIT_REPOSITORY "file://${CMAKE_CURRENT_SOURCE_DIR}/../IOCore" #GIT_TAG HEAD GIT_REPOSITORY "https://gitea.beniquez.me/sdaveb/IOCore.git" - GIT_TAG v0.2.9 + GIT_TAG v0.2.10 OPTIONS "BUILD_SHARED_LIBS OFF" "BUILD_TESTING OFF" diff --git a/editorconfig/local.vimrc b/editorconfig/local.vimrc index 083196c..d68c1c7 100644 --- a/editorconfig/local.vimrc +++ b/editorconfig/local.vimrc @@ -26,7 +26,7 @@ -let s:build_dir = 'vim-debug' +let s:build_dir = 'debug' let s:build_cores = 6 let s:make_args = '-C '. s:build_dir . ' -j ' . s:build_cores . ' all' @@ -83,10 +83,14 @@ function! BuildDebug() vert resize +100 endif endif - + " Check if .compile_commands.json exists in the current working directory + if !filereadable('.compile_commands.json') + " File does not exist, create a symbolic link + execute 'silent !ln -s ' . $PWD . '/.vim/lspbuild/compile_commands.json' . $PWD + endif endfunction -function RunTests() +function! RunTests() if (s:ninja_path != '') if ( \ (!filereadable(s:build_dir . '/CMakeCache.txt')) || diff --git a/include/CgiApplication.hpp b/include/CgiApplication.hpp index 8ce1c24..0b45bb0 100644 --- a/include/CgiApplication.hpp +++ b/include/CgiApplication.hpp @@ -11,6 +11,7 @@ #include "Application.hpp" #include "IRequestHandler.hpp" +#include "types/containers.hpp" #include "types.hpp" @@ -21,6 +22,7 @@ namespace mdml { using IOCore::Application; +using IOCore::Dictionary; class IRouteHandler; diff --git a/include/types/ctypes.hpp b/include/CgiServerApp.hpp similarity index 51% rename from include/types/ctypes.hpp rename to include/CgiServerApp.hpp index 803242d..08d6293 100644 --- a/include/types/ctypes.hpp +++ b/include/CgiServerApp.hpp @@ -1,4 +1,4 @@ -/* ctypes.hpp +/* CgiServerApp.hpp * Copyright © 2024 Saul D. Beniquez * License: Mozilla Public License v. 2.0 * @@ -9,15 +9,25 @@ #pragma once -#include +#include "Application.hpp" +// #include "IRequestHandler.hpp" namespace mdml { -using count_t = std::size_t; -namespace c { -using string = char*; -using const_string = const char*; -} +class IRouteHandler; + +class CgiServerApp + : public IRequestHandler + , public IOCore::Application { + CgiServerApp(int argc, c::const_string argv[], c::const_string env[]) + : IRequestHandler(), IOCore::Application(argc, argv, env) + { + } + ~CgiServerApp() override{}; + + auto run() -> int override; + // auto processRequest() -> void {} +}; } // clang-format off diff --git a/include/MarkdownRouteHandler.hpp b/include/MarkdownRouteHandler.hpp index c6b7039..7ce3574 100644 --- a/include/MarkdownRouteHandler.hpp +++ b/include/MarkdownRouteHandler.hpp @@ -8,6 +8,8 @@ */ #pragma once +#include "types/containers.hpp" + #include "IRouteHandler.hpp" #include "types.hpp" @@ -19,6 +21,7 @@ namespace mdml { namespace { namespace fs = std::filesystem; +using IOCore::Dictionary; } class MarkdownRouteHandler : public IRouteHandler { diff --git a/include/types.hpp b/include/types.hpp index c9be718..4c764c2 100644 --- a/include/types.hpp +++ b/include/types.hpp @@ -9,11 +9,8 @@ #pragma once -#include "types/Result.hpp" -#include "types/ctypes.hpp" - -#include "types/Collections.hpp" #include "types/References.hpp" +#include "types/Result.hpp" // clang-format off // vim: set foldmethod=marker foldmarker=#region,#endregion textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen : diff --git a/include/types/Collections.hpp b/include/types/Collections.hpp deleted file mode 100644 index 1fdd9d3..0000000 --- a/include/types/Collections.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/* Collections.hpp - * Copyright © 2024 Saul D. Beniquez - * License: Mozilla Public License v. 2.0 - * - * This Source Code Form is subject to the terms of the Mozilla Public License, - * v.2.0. If a copy of the MPL was not distributed with this file, You can - * obtain one at https://mozilla.org/MPL/2.0/. - */ - -#pragma once - -#include -#include - -namespace mdml { -template -using Dictionary = std::map; -} - -// clang-format off -// vim: set foldmethod=syntax foldminlines=10 textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen :