summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-05 20:49:28 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-05 20:49:28 +0200
commit028c97404da7ad9ebcbcd9c97903f28e0da222ed (patch)
tree8db275898d1d6540d29fcfc23eba88c2d49b4a65 /examples
parent49d96f61fca89046036454cdd1a5c965277c1740 (diff)
feat: fix: `fix.hpp` engine parser.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/equiv/equiv.cc1
-rw-r--r--examples/fix/CMakeLists.txt12
-rw-r--r--examples/fix/fix.cc25
3 files changed, 38 insertions, 0 deletions
diff --git a/examples/equiv/equiv.cc b/examples/equiv/equiv.cc
index 664602e..1b7b042 100644
--- a/examples/equiv/equiv.cc
+++ b/examples/equiv/equiv.cc
@@ -5,6 +5,7 @@
*/
#include <lib/equiv.hpp>
+#include <lib/fix.hpp>
#include <iostream>
/* finally test it */
diff --git a/examples/fix/CMakeLists.txt b/examples/fix/CMakeLists.txt
new file mode 100644
index 0000000..db8921b
--- /dev/null
+++ b/examples/fix/CMakeLists.txt
@@ -0,0 +1,12 @@
+
+cmake_minimum_required(VERSION 3.15...3.31)
+
+project(
+ Fix
+ VERSION 1.0
+ LANGUAGES CXX)
+
+add_executable(Fix fix.cc)
+
+set_property(TARGET Fix PROPERTY CXX_STANDARD 20)
+target_include_directories(Fix PUBLIC ../../)
diff --git a/examples/fix/fix.cc b/examples/fix/fix.cc
new file mode 100644
index 0000000..1ab258e
--- /dev/null
+++ b/examples/fix/fix.cc
@@ -0,0 +1,25 @@
+/*
+ string checksum example
+ written by Amlal El Mahrouss.
+ licensed under the MIT license
+ */
+
+#include <lib/fix.hpp>
+#include <iostream>
+
+/* finally test it */
+int main(int argc, char** argv)
+{
+ snu::fix::fix_visitor visitor;
+ auto fix = visitor.visit("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|");
+
+ std::cout << "magic: " << fix.msg_magic_ << std::endl;
+
+ for (auto fields : fix.msg_body_)
+ {
+ std::cout << "key: " << fields.first;
+ std::cout << ",value: " << fields.second << std::endl;
+ }
+
+ return 0;
+}