Telnet++  3.1.0.2
A C++ library for interacting with Telnet streams
for_each_request.hpp
1 #pragma once
2 
3 #include "telnetpp/core.hpp"
4 #include "telnetpp/options/new_environ/detail/request_parser_helper.hpp"
5 
6 namespace telnetpp::options::new_environ::detail {
7 
8 template <typename Continuation>
9 void for_each_request(telnetpp::bytes requests, Continuation &&cont)
10 {
11  request_parsing_state state;
12 
13  auto const *current = requests.begin();
14  auto const *end = requests.end();
15 
16  while (current != end)
17  {
18  parse_request_byte(state, current++, cont);
19  }
20 
21  parse_request_end(state, cont);
22 }
23 
24 } // namespace telnetpp::options::new_environ::detail