summaryrefslogtreecommitdiffhomepage
path: root/examples/fix
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-29 14:53:01 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-11-29 14:54:13 -0500
commita8e99f3a783069cf85b626c6cfb2fbe83ae4fd44 (patch)
tree8322b0d20dd02660c3f26fcfd37c2cc4dcd33cda /examples/fix
parent463a0c01f96d86c9c91f02903bc1d194c5e55b15 (diff)
chore: new version of OCL and codebase cleanup.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples/fix')
-rw-r--r--examples/fix/CMakeLists.txt15
-rw-r--r--examples/fix/fix.cc47
2 files changed, 0 insertions, 62 deletions
diff --git a/examples/fix/CMakeLists.txt b/examples/fix/CMakeLists.txt
deleted file mode 100644
index 143b1c4..0000000
--- a/examples/fix/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-
-cmake_minimum_required(VERSION 3.15...3.31)
-
-project(
- Fix
- VERSION 1.0
- LANGUAGES CXX)
-
-find_package(Boost REQUIRED COMPONENTS container)
-
-add_executable(Fix fix.cc)
-
-set_property(TARGET Fix PROPERTY CXX_STANDARD 20)
-target_include_directories(Fix PUBLIC ../../include/ocl)
-target_link_libraries(Fix PRIVATE Boost::container)
diff --git a/examples/fix/fix.cc b/examples/fix/fix.cc
deleted file mode 100644
index f52246f..0000000
--- a/examples/fix/fix.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- fix example
- Written by Amlal El Mahrouss.
- Licensed under the Boost Software License
- */
-
-#include <core/error_handler.hpp>
-#include <fix/parser.hpp>
-#include <iostream>
-#include <unistd.h>
-#include <io/print.hpp>
-#include <sys/socket.h>
-
-/* finally test it */
-int main(int argc, char** argv)
-{
- constexpr const char default_fix[] = {
- '8', '=', 'F', 'I', 'X', '.', '4', '.', '2', 0x01,
- '9', '=', '6', '3', 0x01, // BodyLength = 63
- '3', '5', '=', 'A', 0x01,
- '4', '9', '=', 'S', 'E', 'R', 'V', 'E', 'R', 0x01,
- '5', '6', '=', 'C', 'L', 'I', 'E', 'N', 'T', 0x01,
- '3', '4', '=', '1', '7', '7', 0x01,
- '5', '2', '=', '2', '0', '0', '9', '0', '1', '0', '7', '-', '1', '8', ':', '1', '5', ':', '1', '6', 0x01,
- '9', '8', '=', '0', 0x01,
- '1', '0', '8', '=', '3', '0', 0x01,
- '1', '0', '=', '1', '4', '3', 0x01, 0x00 // CheckSum = 143
- };
-
- ocl::fix::basic_visitor<char> basic_visitor;
- ocl::fix::basic_range_data<char> fix = basic_visitor.visit(default_fix);
-
- std::cout << "magic=" << fix.magic_ << std::endl;
- std::cout << "magic_len=" << fix.magic_len_ << std::endl;
- std::cout << "is_valid=" << std::boolalpha << fix.is_valid() << std::endl;
-
- ocl::basic_error_handler handler;
- ocl::fix::must_pass<char, ocl::basic_error_handler>(fix, handler);
-
- ocl::io::print(":key=35\n");
- ocl::io::print(":value=", fix["35"], "\n");
-
- ocl::io::print(":key=49\n");
- ocl::io::print(":value=", fix["49"], "\n");
-
- return 0;
-}