From ed4f331bc96b4abb711c5b47c969d5ecb3166e15 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 29 Dec 2025 22:43:23 +0100 Subject: feat: fix CMake example, update free functions. Signed-off-by: Amlal El Mahrouss --- example/fix_tag_example/CMakeLists.txt | 8 ++++---- example/fix_tag_example/example.cc | 30 ------------------------------ example/fix_tag_example/example.cpp | 30 ++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 example/fix_tag_example/example.cc create mode 100644 example/fix_tag_example/example.cpp (limited to 'example') diff --git a/example/fix_tag_example/CMakeLists.txt b/example/fix_tag_example/CMakeLists.txt index b9a80db..57bec7a 100644 --- a/example/fix_tag_example/CMakeLists.txt +++ b/example/fix_tag_example/CMakeLists.txt @@ -1,4 +1,4 @@ - +# AMLALE: Hm? cmake_minimum_required(VERSION 3.15...3.31) project( @@ -6,10 +6,10 @@ project( VERSION 1.0 LANGUAGES CXX) -find_package(Boost REQUIRED COMPONENTS container) +find_package(Boost REQUIRED) -add_executable(FixExample example.cc) +add_executable(FixExample example.cpp) set_property(TARGET FixExample PROPERTY CXX_STANDARD 20) target_include_directories(FixExample PUBLIC ../../include/ocl) -target_link_libraries(FixExample PRIVATE Boost::container) +target_link_libraries(FixExample PRIVATE Boost) diff --git a/example/fix_tag_example/example.cc b/example/fix_tag_example/example.cc deleted file mode 100644 index f7f3e76..0000000 --- a/example/fix_tag_example/example.cc +++ /dev/null @@ -1,30 +0,0 @@ -#include - -constexpr 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 -}; - -int main(int argc, char** argv) -{ - ocl::fix::visitor basic_visitor; - ocl::fix::range_buffer fix = basic_visitor.visit(default_fix); - - ocl::io::enable_stdio_sync(false); - - 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; -} diff --git a/example/fix_tag_example/example.cpp b/example/fix_tag_example/example.cpp new file mode 100644 index 0000000..f7f3e76 --- /dev/null +++ b/example/fix_tag_example/example.cpp @@ -0,0 +1,30 @@ +#include + +constexpr 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 +}; + +int main(int argc, char** argv) +{ + ocl::fix::visitor basic_visitor; + ocl::fix::range_buffer fix = basic_visitor.visit(default_fix); + + ocl::io::enable_stdio_sync(false); + + 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; +} -- cgit v1.2.3