summaryrefslogtreecommitdiffhomepage
path: root/examples/fix/fix.cc
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/fix/fix.cc
parent49d96f61fca89046036454cdd1a5c965277c1740 (diff)
feat: fix: `fix.hpp` engine parser.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'examples/fix/fix.cc')
-rw-r--r--examples/fix/fix.cc25
1 files changed, 25 insertions, 0 deletions
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;
+}