From 65a8349aa5526d071b18cd4d42586c46faaa3823 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 24 Nov 2025 02:13:48 +0100 Subject: feat! breaking changes for OCL v1.0.48. Signed-off-by: Amlal El Mahrouss --- examples/cgi/CMakeLists.txt | 16 ++++++++++ examples/cgi/cgi.cc | 75 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 examples/cgi/CMakeLists.txt create mode 100644 examples/cgi/cgi.cc (limited to 'examples/cgi') diff --git a/examples/cgi/CMakeLists.txt b/examples/cgi/CMakeLists.txt new file mode 100644 index 0000000..e30707c --- /dev/null +++ b/examples/cgi/CMakeLists.txt @@ -0,0 +1,16 @@ + +cmake_minimum_required(VERSION 3.15...3.31) + +project( + CGI + 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 ../../include/ocl) diff --git a/examples/cgi/cgi.cc b/examples/cgi/cgi.cc new file mode 100644 index 0000000..b837433 --- /dev/null +++ b/examples/cgi/cgi.cc @@ -0,0 +1,75 @@ +/* + cgi example + written by Amlal El Mahrouss. + licensed under the Boost Software License + */ + +#include + +static ocl::basic_chunk_string text_sample = R"( + + + + + Error | OCL + + + +

Uh Oh!

+
No index file was found in this directory.
+
+ + + + + + + + + +
Name

Refresh

+
OCL's Common Gateway Server.
+ + +)"; + +/* finally test it */ +/* @brief this stub loads a 'index.html' or returns an error message if not found. */ +int main(int argc, char** argv) +{ + ocl::cgi::basic_writer<> writer; + writer << text_sample; + + return 0; +} -- cgit v1.2.3