diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-24 14:13:34 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-24 14:13:34 +0200 |
| commit | b0d0e894a4394eed25dbb5cead12edd08a510a92 (patch) | |
| tree | 788915894a49d5267391f3bf6b9c41a1c5fe40b8 /dev/examples | |
| parent | d02bd0eb656b885bdf48088529183c40df8bd9c1 (diff) | |
feat! use `chunk_string` in the CGI module. Add additional constructors
for `chunk_string`
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/examples')
| -rw-r--r-- | dev/examples/cgi/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | dev/examples/cgi/cgi.cc | 11 | ||||
| -rw-r--r-- | dev/examples/fix/fix.cc | 2 |
3 files changed, 7 insertions, 10 deletions
diff --git a/dev/examples/cgi/CMakeLists.txt b/dev/examples/cgi/CMakeLists.txt index 391899f..9c3cbf6 100644 --- a/dev/examples/cgi/CMakeLists.txt +++ b/dev/examples/cgi/CMakeLists.txt @@ -6,7 +6,11 @@ project( VERSION 1.0 LANGUAGES CXX) +find_package(Boost REQUIRED COMPONENTS container) + add_executable(CGI cgi.cc) +target_link_libraries(CGI PRIVATE Boost::container) + set_property(TARGET CGI PROPERTY CXX_STANDARD 20) target_include_directories(CGI PUBLIC ../../) diff --git a/dev/examples/cgi/cgi.cc b/dev/examples/cgi/cgi.cc index 4872cb5..7d8353a 100644 --- a/dev/examples/cgi/cgi.cc +++ b/dev/examples/cgi/cgi.cc @@ -5,11 +5,8 @@ */ #include <lib/utility/cgi_writer.hpp> -#include <fstream> -#include <sstream> -#include <string> -const std::string error_html = R"( +static snu::basic_chunk_string<char> text_sample = R"( <!DOCTYPE html> <html> <head> @@ -72,11 +69,7 @@ const std::string error_html = R"( int main(int argc, char** argv) { snu::cgi::basic_writer<> writer; - - std::stringstream ss_file; - ss_file << error_html; - - writer.html(ss_file); + writer << text_sample; return 0; } diff --git a/dev/examples/fix/fix.cc b/dev/examples/fix/fix.cc index ce48186..8730cad 100644 --- a/dev/examples/fix/fix.cc +++ b/dev/examples/fix/fix.cc @@ -4,7 +4,7 @@ licensed under the MIT license */ -#include <lib/net/network.hpp> +#include <lib/net/modem.hpp> #include <lib/fix/parser.hpp> #include <iostream> #include <unistd.h> |
