summaryrefslogtreecommitdiff
path: root/kel_cpp_boilerplate/c++/blueprints/main_cpp.hpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2025-10-29 16:39:14 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2025-10-29 16:39:14 +0100
commitdfc45729d342f6f4d4d9ea39649c49b49fa178c6 (patch)
treefd66c76073b0eff3f184e1dcaa612c9e73eb7efd /kel_cpp_boilerplate/c++/blueprints/main_cpp.hpp
downloadapps-dev_tools-dfc45729d342f6f4d4d9ea39649c49b49fa178c6.tar.gz
Initial commit
Diffstat (limited to 'kel_cpp_boilerplate/c++/blueprints/main_cpp.hpp')
-rw-r--r--kel_cpp_boilerplate/c++/blueprints/main_cpp.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/kel_cpp_boilerplate/c++/blueprints/main_cpp.hpp b/kel_cpp_boilerplate/c++/blueprints/main_cpp.hpp
new file mode 100644
index 0000000..353a045
--- /dev/null
+++ b/kel_cpp_boilerplate/c++/blueprints/main_cpp.hpp
@@ -0,0 +1,36 @@
+#pragma once
+#include <string_view>
+
+constexpr std::string_view main_cpp_dir_name = "app/c++";
+constexpr std::string_view main_cpp_file_name = "main.cpp";
+
+constexpr std::string_view main_cpp_file_content = R"(
+#include <forstio/error.hpp>
+#include <iostream>
+
+namespace kel {
+saw::error_or<void> kel_main(int argc, char** argv){
+ (void) argc;
+ (void) argv;
+ return saw::make_void();
+}
+}
+
+int main(int argc, char** argv){
+ auto eov = kel::kel_main(argc, argv);
+ if(eov.is_error()){
+ auto& err = eov.get_error();
+ auto err_msg = err.get_message();
+ std::cerr<<"[Error]: "<<err.get_category();
+
+ if(not err_msg.empty()){
+ std::cerr<<" - "<<err_msg;
+ }
+ std::cerr<<std::endl;
+
+ return err.get_id();
+ }
+
+ return 0;
+}
+)";