Telnet++ 4.0.0.9
A C++ library for interacting with Telnet streams
Loading...
Searching...
No Matches
generator.hpp
1#pragma once
2
3#include "telnetpp/detail/generate_helper.hpp"
4#include "telnetpp/detail/overloaded.hpp"
5#include "telnetpp/element.hpp"
6
7namespace telnetpp {
8
9//* =========================================================================
15//* =========================================================================
16template <class Continuation>
17constexpr void generate(telnetpp::element const &elem, Continuation &&cont)
18{
19 std::visit(
20 detail::overloaded{
21 [&cont](telnetpp::bytes data) {
22 detail::generate_escaped(data, cont);
23 },
24 [&cont](telnetpp::command const &cmd) {
25 detail::generate_command(cmd, cont);
26 },
27 [&cont](telnetpp::negotiation const &neg) {
28 detail::generate_negotiation(neg, cont);
29 },
30 [&cont](telnetpp::subnegotiation const &sub) {
31 detail::generate_subnegotiation(sub, cont);
32 }},
33 elem);
34}
35
36} // namespace telnetpp
A class that encapsulates the value of a Telnet command.
Definition command.hpp:13
A common type that can contain any Telnet operation, such as a command, negotiation,...
A class that encapsulates a Telnet negotiation.
Definition negotiation.hpp:15
A class that encapsulates a Telnet subnegotiation.
Definition subnegotiation.hpp:14