Re-use code from my new external library, IOCore. Fix compile errors.
Some checks failed
buildbot/mdml-cgi-linux-builder Build done.
buildbot/mdml-cgi-freebsd-builder Build done.

- Change vim-integrated build directory.
- Add WIP CgiServerApp class.
- Fix IOCore repository URL
This commit is contained in:
S David 2024-04-19 20:10:57 -04:00
parent 2582bf7e2f
commit e0d46c18a8
7 changed files with 31 additions and 36 deletions

View File

@ -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"

View File

@ -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')) ||

View File

@ -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;

View File

@ -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 <cstddef>
#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

View File

@ -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 {

View File

@ -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 :

View File

@ -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 <map>
#include <string>
namespace mdml {
template<typename TValue>
using Dictionary = std::map<const std::string, TValue>;
}
// clang-format off
// vim: set foldmethod=syntax foldminlines=10 textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen :