From e20285288afb45c66144b45b1cf6ea6bc4642484 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 25 Nov 2025 10:39:37 +0100 Subject: fix: ocl/fix: hotpatch for ascii_bytes_ -> bytes_ Signed-off-by: Amlal El Mahrouss --- include/ocl/fix/parser.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/ocl/fix/parser.hpp b/include/ocl/fix/parser.hpp index 5d4e5eb..09b58c1 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{}; - return std::basic_string(basic_range.ascii_bytes_, basic_range.length_); + return std::basic_string(basic_range.bytes_, basic_range.length_); } /// @brief a basic_range object containing the FIX packet values. -- cgit v1.2.3 From e96beb23f6d09d323f5cbd2ba9f8b6d4fcc7428b Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 25 Nov 2025 10:16:37 -0500 Subject: feat: fix: use const T& when calling `visit`. Signed-off-by: Amlal El Mahrouss --- examples/fix/fix.cc | 10 ++++++---- examples/opt/opt.cc | 4 ++-- include/ocl/fix/parser.hpp | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'include') 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 -#include #include #include #include @@ -38,8 +37,11 @@ int main(int argc, char** argv) ocl::basic_error_handler handler; ocl::fix::must_pass(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 09b58c1..02ab50c 100644 --- a/include/ocl/fix/parser.hpp +++ b/include/ocl/fix/parser.hpp @@ -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 visit(std::basic_string in) + basic_range_data visit(const std::basic_string& in) { basic_range_data ret{}; -- cgit v1.2.3