summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-22 15:47:42 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-22 15:47:42 +0100
commit9c692ebc9cf9fda989be3abd6a3b286262559f4f (patch)
tree28f1f9fa8a699585e0c18f746f50eca75de5d1d6 /lib
parentd4c96e62326293f668eda90788c7d8e872233bd3 (diff)
feat: fix/parser: 'range' object may not hold ASCII bytes, or a text FIX packet, refactor code and add documentation for it.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/fix/network.hpp2
-rw-r--r--lib/fix/parser.hpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/fix/network.hpp b/lib/fix/network.hpp
index 9186b15..0ca0920 100644
--- a/lib/fix/network.hpp
+++ b/lib/fix/network.hpp
@@ -14,7 +14,7 @@
namespace snu::fix
{
class network_rx;
- class network_tx;
+ class network_tx;
} // 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 3ab5467..95d05e6 100644
--- a/lib/fix/parser.hpp
+++ b/lib/fix/parser.hpp
@@ -56,12 +56,12 @@ namespace snu::fix
template <typename char_type>
struct range final
{
- char_type* ascii_bytes_;
- uint16_t length_;
+ char_type* bytes_;
+ size_t length_;
bool is_valid()
{
- return ascii_bytes_ && length_ > 0;
+ return bytes_ && length_ > 0;
}
operator bool()
@@ -71,6 +71,7 @@ namespace snu::fix
};
/// @brief Convert range to usable string.
+ /// @note This function assumes that the range is valid and contains ASCII bytes.
template <typename char_type>
inline std::basic_string<char_type> to_string(range<char_type>& range) noexcept
{