forked from awwit/httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataVariantAbstract.h
More file actions
49 lines (43 loc) · 1.62 KB
/
DataVariantAbstract.h
File metadata and controls
49 lines (43 loc) · 1.62 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
48
49
#pragma once
#include "Socket.h"
#include "FileIncoming.h"
#include <unordered_map>
namespace HttpServer
{
class DataVariantAbstract
{
protected:
std::string data_variant_name;
public:
inline std::string getName() const
{
return data_variant_name;
};
public:
/**
* virtual destructor
*/
virtual ~DataVariantAbstract() = default;
/**
* @param const Socket & - сокет, откуда можно достать остальные данные
* @param const std::chrono::milliseconds & - максимальное время ожидания данных (на сокете)
* @param std::string & - первая часть полученных данных
* @param const size_t - сколько осталось данных (в байтах) получить из сокета
* @param const std::unordered_map<std::string, std::string> & - дополнительные параметры, описывающие формат данных
* @param std::unordered_multimap<std::string, std::string> & - данные в виде ключ->значение
* @param std::unordered_multimap<std::string, FileIncoming> & - имена файлов, в которые записаны данные
*
* @return bool - (true|false) - удачно ли были разобраны данные
*/
virtual bool parse
(
const Socket &,
const std::chrono::milliseconds &,
std::string &,
const size_t,
const std::unordered_map<std::string, std::string> &,
std::unordered_multimap<std::string, std::string> &,
std::unordered_multimap<std::string, FileIncoming> &
) = 0;
};
};