Re-use code from my new external library, IOCore. Fix compile errors.
- Change vim-integrated build directory. - Add WIP CgiServerApp class. - Fix IOCore repository URL
This commit is contained in:
parent
2582bf7e2f
commit
e0d46c18a8
@ -90,7 +90,7 @@ CPMAddPackage(NAME IOCore
|
|||||||
#GIT_REPOSITORY "file://${CMAKE_CURRENT_SOURCE_DIR}/../IOCore"
|
#GIT_REPOSITORY "file://${CMAKE_CURRENT_SOURCE_DIR}/../IOCore"
|
||||||
#GIT_TAG HEAD
|
#GIT_TAG HEAD
|
||||||
GIT_REPOSITORY "https://gitea.beniquez.me/sdaveb/IOCore.git"
|
GIT_REPOSITORY "https://gitea.beniquez.me/sdaveb/IOCore.git"
|
||||||
GIT_TAG v0.2.9
|
GIT_TAG v0.2.10
|
||||||
OPTIONS
|
OPTIONS
|
||||||
"BUILD_SHARED_LIBS OFF"
|
"BUILD_SHARED_LIBS OFF"
|
||||||
"BUILD_TESTING OFF"
|
"BUILD_TESTING OFF"
|
||||||
|
10
editorconfig/local.vimrc
vendored
10
editorconfig/local.vimrc
vendored
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
let s:build_dir = 'vim-debug'
|
let s:build_dir = 'debug'
|
||||||
let s:build_cores = 6
|
let s:build_cores = 6
|
||||||
let s:make_args = '-C '. s:build_dir . ' -j ' . s:build_cores . ' all'
|
let s:make_args = '-C '. s:build_dir . ' -j ' . s:build_cores . ' all'
|
||||||
|
|
||||||
@ -83,10 +83,14 @@ function! BuildDebug()
|
|||||||
vert resize +100
|
vert resize +100
|
||||||
endif
|
endif
|
||||||
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
|
endfunction
|
||||||
|
|
||||||
function RunTests()
|
function! RunTests()
|
||||||
if (s:ninja_path != '')
|
if (s:ninja_path != '')
|
||||||
if (
|
if (
|
||||||
\ (!filereadable(s:build_dir . '/CMakeCache.txt')) ||
|
\ (!filereadable(s:build_dir . '/CMakeCache.txt')) ||
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "Application.hpp"
|
#include "Application.hpp"
|
||||||
#include "IRequestHandler.hpp"
|
#include "IRequestHandler.hpp"
|
||||||
|
#include "types/containers.hpp"
|
||||||
|
|
||||||
#include "types.hpp"
|
#include "types.hpp"
|
||||||
|
|
||||||
@ -21,6 +22,7 @@
|
|||||||
namespace mdml {
|
namespace mdml {
|
||||||
|
|
||||||
using IOCore::Application;
|
using IOCore::Application;
|
||||||
|
using IOCore::Dictionary;
|
||||||
|
|
||||||
class IRouteHandler;
|
class IRouteHandler;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* ctypes.hpp
|
/* CgiServerApp.hpp
|
||||||
* Copyright © 2024 Saul D. Beniquez
|
* Copyright © 2024 Saul D. Beniquez
|
||||||
* License: Mozilla Public License v. 2.0
|
* License: Mozilla Public License v. 2.0
|
||||||
*
|
*
|
||||||
@ -9,15 +9,25 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstddef>
|
#include "Application.hpp"
|
||||||
|
// #include "IRequestHandler.hpp"
|
||||||
|
|
||||||
namespace mdml {
|
namespace mdml {
|
||||||
using count_t = std::size_t;
|
|
||||||
|
|
||||||
namespace c {
|
class IRouteHandler;
|
||||||
using string = char*;
|
|
||||||
using const_string = const char*;
|
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
|
// clang-format off
|
@ -8,6 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "types/containers.hpp"
|
||||||
|
|
||||||
#include "IRouteHandler.hpp"
|
#include "IRouteHandler.hpp"
|
||||||
#include "types.hpp"
|
#include "types.hpp"
|
||||||
|
|
||||||
@ -19,6 +21,7 @@ namespace mdml {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
using IOCore::Dictionary;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MarkdownRouteHandler : public IRouteHandler {
|
class MarkdownRouteHandler : public IRouteHandler {
|
||||||
|
@ -9,11 +9,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "types/Result.hpp"
|
|
||||||
#include "types/ctypes.hpp"
|
|
||||||
|
|
||||||
#include "types/Collections.hpp"
|
|
||||||
#include "types/References.hpp"
|
#include "types/References.hpp"
|
||||||
|
#include "types/Result.hpp"
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// vim: set foldmethod=marker foldmarker=#region,#endregion textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen :
|
// vim: set foldmethod=marker foldmarker=#region,#endregion textwidth=80 ts=8 sts=0 sw=8 noexpandtab ft=cpp.doxygen :
|
||||||
|
@ -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 :
|
|
Loading…
Reference in New Issue
Block a user