Low-Level C++ SDK  v1.1
Loading...
Searching...
No Matches
WeArtMessageSerializer.h
Go to the documentation of this file.
1#pragma once
2
3#include "WeArtMessages.h"
4#include <sstream>
5
7class WeArtMessageSerializer {
8public:
9 const char separator = ':';
10
11 static constexpr unsigned long long int HashStringToInt(const char* str, unsigned long long int hash = 0) {
12 return (*str == 0) ? hash : 101 * HashStringToInt(str + 1) + *str;
13 }
14
18 static WeArtMessage* createMessage(std::string& ID);
19
23 std::string Serialize(WeArtMessage* message);
24
28 uint8* Serialize(std::string text);
29
33 WeArtMessage* Deserialize(std::string data);
34
35 // Bytestream to std::string.
36
41 std::string Deserialize(uint8* byteData, int byteCount);
42};