-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathext_properties.hpp
More file actions
44 lines (38 loc) · 818 Bytes
/
ext_properties.hpp
File metadata and controls
44 lines (38 loc) · 818 Bytes
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
#pragma once
#include <string>
#include <vector>
namespace settings
{
struct address_t
{
#if defined __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wpadded"
#endif
uint16_t port = 0;
std::string host;
#if defined __clang__
#pragma clang diagnostic pop
#endif
bool operator<(const address_t &rhs) const
{
if (host == rhs.host) return port < rhs.port;
return host < rhs.host;
}
};
struct file_t
{
std::string name;
std::string content;
bool operator<(const file_t &rhs) const
{
if (name == rhs.name) return content < rhs.content;
return name < rhs.name;
}
};
struct shard_t
{
std::vector<size_t> shards;
bool operator<(const shard_t &rhs) const { return shards < rhs.shards; }
};
} // namespace settings