]> git.tdb.fi Git - xinema.git/blob - source/client.h
1f543fc15861f4ebaf2e4cd923e05d38c4d1f37a
[xinema.git] / source / client.h
1 #ifndef CLIENT_H_
2 #define CLIENT_H_
3
4 #include <msp/fs/path.h>
5 #include <msp/net/streamsocket.h>
6
7 class Xinema;
8
9 class Client
10 {
11 private:
12         Xinema &xinema;
13         Msp::Net::StreamSocket *socket;
14         std::string buffer;
15         bool stale;
16
17 public:
18         Client(Xinema &, Msp::Net::StreamSocket *);
19
20         bool is_stale() const { return stale; }
21
22 private:
23         void data_available();
24         void end_of_stream();
25
26         void process_command(const std::string &);
27         void send_reply(const std::string &);
28         void list_directory(const Msp::FS::Path &);
29 };
30
31 #endif