Telnet++
A C++ library for interacting with Telnet streams
client.hpp
1 #pragma once
2 
3 #include "telnetpp/client_option.hpp"
4 #include <boost/signals2/signal.hpp>
5 #include <vector>
6 
7 namespace telnetpp { namespace options { namespace new_environ {
8 
9 //* =========================================================================
11 //* =========================================================================
12 enum class variable_type
13 {
14  var,
15  uservar
16 };
17 
18 //* =========================================================================
20 //* =========================================================================
21 struct request
22 {
23  variable_type type;
24  std::string name;
25 };
26 
27 //* =========================================================================
29 //* =========================================================================
30 struct response
31 {
32  variable_type type;
33  std::string name;
34  boost::optional<std::string> value;
35 };
36 
37 //* =========================================================================
40 //* =========================================================================
41 class TELNETPP_EXPORT client : public telnetpp::client_option
42 {
43 public :
44  //* =====================================================================
46  //* =====================================================================
47  client();
48 
49  //* =====================================================================
52  //* =====================================================================
53  std::vector<token> request_variables(std::vector<request> const &requests);
54 
55  //* =====================================================================
61  //* =====================================================================
62  boost::signals2::signal<
63  std::vector<token> (response const &res),
65  > on_variable_changed;
66 
67 private :
68  //* =====================================================================
71  //* =====================================================================
72  std::vector<telnetpp::token> handle_subnegotiation(u8stream const &content);
73 
74 };
75 
76 }}}
A response that is received from the remote server.
Definition: client.hpp:30
An implementation of the client side of the Telnet New-Environ option.
Definition: client.hpp:41
A class that represents a Telnet option&#39;s client side.
Definition: client_option.hpp:34
A collection of bytes that models the Standard Library&#39;s Container concept.
A combiner for tokens.
Definition: element.hpp:47
A request that is made of the remote server.
Definition: client.hpp:21
Definition: byte_converter.hpp:4
variable_type
An enumeration of the type of variables that NEW_ENVIRON handles.
Definition: client.hpp:12