From 6f454424153fc205e519f7aada62837487600a8e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 8 Jul 2025 09:28:31 +0200 Subject: refactor: New Embfs TeX specs, and reworked SNU-LIB's fix module. Signed-off-by: Amlal El Mahrouss --- lib/fix/network.hpp | 5 +++++ lib/fix/parser.hpp | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) (limited to 'lib/fix') diff --git a/lib/fix/network.hpp b/lib/fix/network.hpp index 0c167e5..95de49b 100644 --- a/lib/fix/network.hpp +++ b/lib/fix/network.hpp @@ -11,4 +11,9 @@ #include #include +namespace snu::fix +{ + +} + #endif // ifndef _SNU_FIX_NETWORK_HPP \ No newline at end of file diff --git a/lib/fix/parser.hpp b/lib/fix/parser.hpp index c20fe2f..edafc5a 100644 --- a/lib/fix/parser.hpp +++ b/lib/fix/parser.hpp @@ -17,21 +17,21 @@ namespace snu::fix { - struct fix_visitor; - struct fix_range; - struct fix_range_data; + struct visitor; + struct range; + struct range_data; /// @brief Buffer+Length structure - typedef fix_range* fix_range_ptr_t; + typedef range* range_ptr_t; - struct fix_range final + struct range final { char* ascii_bytes_; uint16_t length_; }; /// @brief Convert range to usable string. - inline std::string to_string(fix_range& range) noexcept + inline std::string to_string(range& range) noexcept { if (range.length_ < 0) return ""; @@ -39,7 +39,7 @@ namespace snu::fix return std::string(range.ascii_bytes_, range.length_); } - class fix_range_data final + class range_data final { public: std::string msg_magic_; @@ -47,21 +47,21 @@ namespace snu::fix std::vector> msg_body_; }; - class fix_visitor final + class visitor final { public: static constexpr auto soh = '|'; static constexpr auto base = 10U; - explicit fix_visitor() = default; - ~fix_visitor() = default; + explicit visitor() = default; + ~visitor() = default; - fix_visitor& operator=(const fix_visitor&) = default; - fix_visitor(const fix_visitor&) = default; + visitor& operator=(const visitor&) = default; + visitor(const visitor&) = default; - fix_range_data visit(const std::string& in) + range_data visit(const std::string& in) { - fix_range_data ret{}; + range_data ret{}; std::string in_tmp; -- cgit v1.2.3