-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientHelper.h
More file actions
47 lines (43 loc) · 1.01 KB
/
ClientHelper.h
File metadata and controls
47 lines (43 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include <string>
#include <vector>
#include <sstream>
#include "Client.h"
#include "Message.h"
#include "Logger.h"
#include "FileInputOutput.h"
#include "Globals.h"
class ClientHelper
{
// Singleton stuff
public:
static ClientHelper& __instance()
{
static ClientHelper ch;
return ch;
}
private:
ClientHelper();
ClientHelper( ClientHelper const& ) = delete;
void operator=( ClientHelper const& ) = delete;
// class specific stuff
/*
public:
ClientHelper();
ClientHelper( std::string serverName,std::string serverPort,std::string delimiter,std::string clientID );
*/
public:
std::vector<std::string> SendRequest( std::string request );
std::string SendRequest_str( std::string request );
std::string GetClientID();
private:
Message CreateMessage( std::string content );
void CallFunction( const Message& msg,bool to_vec = false );
private:
std::string m_serverName;
std::string m_serverPort;
char m_delimiter;
std::string m_clientID;
std::vector<std::string> m_dataVec;
std::string m_data;
};