diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-01 09:09:57 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-01 09:09:57 +0100 |
| commit | 284708d1e8a14867b5276a8e760588d8531835d8 (patch) | |
| tree | 9f651db6d8b51bf97f2fd2fb41efbf5e53498eea /dev/lib/fix/parser.hpp | |
| parent | 574d373163f7edade42e935b9e6957cdaf08d94b (diff) | |
feat: generic: new `except` module, network model for FIX, and tracked_ptr improvements.
feat: introduce the `must_pass` concept to validate a container.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/fix/parser.hpp')
| -rw-r--r-- | dev/lib/fix/parser.hpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/dev/lib/fix/parser.hpp b/dev/lib/fix/parser.hpp index e432b6c..e007906 100644 --- a/dev/lib/fix/parser.hpp +++ b/dev/lib/fix/parser.hpp @@ -86,9 +86,9 @@ namespace snu::fix class range_data final { public: - std::basic_string<char_type> msg_magic_; - std::size_t msg_body_len_; - std::vector<std::pair<std::basic_string<char_type>, std::basic_string<char_type>>> msg_body_; + std::basic_string<char_type> magic_; + std::size_t body_len_; + std::vector<std::pair<std::basic_string<char_type>, std::basic_string<char_type>>> body_; static inline const char_type* begin = detail::begin_fix<char_type>(); @@ -105,19 +105,20 @@ namespace snu::fix return std::basic_string<char_type>{}; } - for (const auto& pair : msg_body_) + for (const auto& pair : this->body_) { if (pair.first == key) { return pair.second; } } + return std::basic_string<char_type>{}; } bool is_valid() { - return msg_magic_.starts_with(range_data<char_type>::begin); + return magic_.starts_with(range_data<char_type>::begin); } operator bool() @@ -170,14 +171,14 @@ namespace snu::fix std::basic_string<char_type> key = in_tmp.substr(0, in_tmp.find(visitor::eq)); std::basic_string<char_type> val = in_tmp.substr(in_tmp.find(visitor::eq) + 1); - if (ret.msg_magic_.empty()) + if (ret.magic_.empty()) { - ret.msg_magic_ = val; + ret.magic_ = val; } else { - ret.msg_body_.emplace_back(std::make_pair(key, val)); - ret.msg_body_len_ += in_tmp.size(); + ret.body_.emplace_back(std::make_pair(key, val)); + ret.body_len_ += in_tmp.size(); } in_tmp.clear(); |
