|
1 #ifndef VMAILMGR__SERVER__H__ |
|
2 #define VMAILMGR__SERVER__H__ |
|
3 |
|
4 #include "mystring/mystring.h" |
|
5 #include "misc/response.h" |
|
6 #include "config/configrc.h" |
|
7 |
|
8 class server_call |
|
9 { |
|
10 private: |
|
11 mystring cmd; |
|
12 unsigned argc; |
|
13 mystring* args; |
|
14 int fd; |
|
15 |
|
16 server_call(); |
|
17 server_call(const server_call&); |
|
18 |
|
19 mystring build_msg() const; |
|
20 int connect(const mystring&) const; |
|
21 void disconnect(); |
|
22 |
|
23 public: |
|
24 server_call(mystring, unsigned a = 0); |
|
25 server_call(mystring, mystring); |
|
26 server_call(mystring, mystring, mystring); |
|
27 server_call(mystring, mystring, mystring, mystring); |
|
28 server_call(mystring, mystring, mystring, mystring, mystring); |
|
29 server_call(mystring, mystring, mystring, mystring, mystring, mystring); |
|
30 server_call(mystring, mystring, mystring, mystring, mystring, mystring, |
|
31 mystring); |
|
32 ~server_call(); |
|
33 response call(const mystring& = config->socket_file()); |
|
34 void operand(int i, mystring m) { args[i] = m; } |
|
35 mystring operand(int i) const { return args[i]; } |
|
36 int socket() const { return fd; } |
|
37 }; |
|
38 |
|
39 #endif |