summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-11-25 10:27:23 -0500
committerGitHub <noreply@github.com>2025-11-25 10:27:23 -0500
commitd8a8f00d255dd0eaea2febc29ba2e91b1458521e (patch)
tree578f04d916ad699e967df1134fa44d4a10b81b8e
parent11184da83066ebc60bfd8b5d077b2bedd4d5084b (diff)
parente96beb23f6d09d323f5cbd2ba9f8b6d4fcc7428b (diff)
Merge pull request #24 from amlel-el-mahrouss/develop
develop->master
-rw-r--r--examples/fix/CMakeLists.txt3
-rw-r--r--examples/fix/fix.cc10
-rw-r--r--examples/opt/opt.cc4
-rw-r--r--include/ocl/fix/parser.hpp4
4 files changed, 13 insertions, 8 deletions
diff --git a/examples/fix/CMakeLists.txt b/examples/fix/CMakeLists.txt
index 1001563..143b1c4 100644
--- a/examples/fix/CMakeLists.txt
+++ b/examples/fix/CMakeLists.txt
@@ -6,7 +6,10 @@ project(
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
index 8c019ce..f52246f 100644
--- a/examples/fix/fix.cc
+++ b/examples/fix/fix.cc
@@ -1,11 +1,10 @@
/*
fix example
- written by Amlal El Mahrouss.
- licensed under the Boost Software License
+ Written by Amlal El Mahrouss.
+ Licensed under the Boost Software License
*/
#include <core/error_handler.hpp>
-#include <net/modem.hpp>
#include <fix/parser.hpp>
#include <iostream>
#include <unistd.h>
@@ -38,8 +37,11 @@ int main(int argc, char** argv)
ocl::basic_error_handler handler;
ocl::fix::must_pass<char, ocl::basic_error_handler>(fix, handler);
- ocl::io::print(":key=9\n");
+ 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/examples/opt/opt.cc b/examples/opt/opt.cc
index 75abed4..dbeab2f 100644
--- a/examples/opt/opt.cc
+++ b/examples/opt/opt.cc
@@ -37,8 +37,8 @@ int main(int argc, char** argv)
ocl::io::println("Testing data...");
- auto opt = do_some("Ohio", "Ohio");
- opt.expect("Checksum failed, Ohio isn't Ohio!");
+ auto opt = do_some("Foo", "Foo");
+ opt.expect("Checksum failed, Foo isn't Foo!");
return 0;
diff --git a/include/ocl/fix/parser.hpp b/include/ocl/fix/parser.hpp
index 5d4e5eb..02ab50c 100644
--- a/include/ocl/fix/parser.hpp
+++ b/include/ocl/fix/parser.hpp
@@ -77,7 +77,7 @@ namespace ocl::fix
if (basic_range.length_ < 0)
return std::basic_string<char_type>{};
- return std::basic_string<char_type>(basic_range.ascii_bytes_, basic_range.length_);
+ return std::basic_string<char_type>(basic_range.bytes_, basic_range.length_);
}
/// @brief a basic_range object containing the FIX packet values.
@@ -148,7 +148,7 @@ namespace ocl::fix
/// @brief Visit a FIX message and parse it into a basic_range_data object.
/// @param in The input FIX message as a string.
/// @warning This function may throw exceptions.
- basic_range_data<char_type> visit(std::basic_string<char_type> in)
+ basic_range_data<char_type> visit(const std::basic_string<char_type>& in)
{
basic_range_data<char_type> ret{};