From 65a8349aa5526d071b18cd4d42586c46faaa3823 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 24 Nov 2025 02:13:48 +0100 Subject: feat! breaking changes for OCL v1.0.48. Signed-off-by: Amlal El Mahrouss --- examples/fix/fix.cc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 examples/fix/fix.cc (limited to 'examples/fix/fix.cc') diff --git a/examples/fix/fix.cc b/examples/fix/fix.cc new file mode 100644 index 0000000..eabe3ac --- /dev/null +++ b/examples/fix/fix.cc @@ -0,0 +1,37 @@ +/* + fix example + written by Amlal El Mahrouss. + licensed under the Boost Software License + */ + +#include +#include +#include +#include +#include +#include +#include + +/* finally test it */ +int main(int argc, char** argv) +{ + constexpr auto default_fix = "8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|"; + + ocl::fix::basic_visitor basic_visitor; + ocl::fix::basic_range_data 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(fix, handler); + + for (auto fields : fix.body_) + { + ocl::io::print("key=", fields.first); + ocl::io::print(", value=", fields.second); + } + + return 0; +} -- cgit v1.2.3