-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathStompMessage.h
41 lines (29 loc) · 960 Bytes
/
StompMessage.h
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
#pragma once
#ifndef BUILD_STATIC
# if defined(QTWEBSTOMPCLIENTDLL_LIB)
# define QTWEBSTOMPCLIENTDLL_EXPORT Q_DECL_EXPORT
# else
# define QTWEBSTOMPCLIENTDLL_EXPORT Q_DECL_IMPORT
# endif
#else
# define QTWEBSTOMPCLIENTDLL_EXPORT
#endif
#include <QtCore/qglobal.h>
#include <map>
#include <string>
#include <vector>
using namespace std;
class QTWEBSTOMPCLIENTDLL_EXPORT StompMessage {
public:
/* This constructor is not meant for the user, just for the dll*/
StompMessage(const char* rawMessage);
StompMessage(string messageType, map<string, string> headers, const char* messageBody = "");
/* Creates a string with the message in a readable format =)*/
std::string toString() const;
enum MessageType { CONNECT, SUBSCRIBE, SEND, MESSAGE };
map<string, string> m_headers;
string m_message;
string m_messageType;
private:
vector<string> messageToVector(const string& str, const string& delim);
};