28 lines
552 B
C
28 lines
552 B
C
|
#ifndef __CLIENT_H__
|
||
|
#define __CLIENT_H__
|
||
|
|
||
|
#include <sstream>
|
||
|
#include <string>
|
||
|
|
||
|
class ClientPrivate;
|
||
|
|
||
|
class Client {
|
||
|
friend class ClientPrivate;
|
||
|
|
||
|
public:
|
||
|
Client();
|
||
|
~Client();
|
||
|
std::string id() const;
|
||
|
static std::string randomId(size_t length);
|
||
|
void log(const std::string &message);
|
||
|
std::string log() const;
|
||
|
bool setRemoteId(const std::string &id);
|
||
|
bool sendMessage(const std::string &message);
|
||
|
|
||
|
private:
|
||
|
ClientPrivate *m_d = nullptr;
|
||
|
std::string m_id;
|
||
|
std::ostringstream m_oss;
|
||
|
};
|
||
|
|
||
|
#endif // __CLIENT_H__
|