forked from tjjh89017/ezio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.hpp
49 lines (40 loc) · 986 Bytes
/
config.hpp
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
#ifndef __CONFIG_HPP__
#define __CONFIG_HPP__
#define BOOST_PROGRAM_OPTIONS_DYN_LINK 1
#include <boost/program_options.hpp>
#include <iostream>
#include <vector>
namespace bpo = boost::program_options;
class config {
public:
void parse_from_argv(int argc, char **argv);
// -t
int timeout_ezio = 15; // Default timeout (min)
// -e
int seed_limit_ezio = 3; // Default seeding ratio limit
// -m
int max_upload_ezio = 4;
// -c
int max_connection_ezio = max_upload_ezio + 2;
// -k
int max_contact_tracker_times = 30; // Max error times for scrape tracker
// -s
bool sequential_flag = false;
// -U
bool seed_flag = false;
// -f
bool file_flag = false;
// --cache in KiB
int cache_size = -1;
#ifdef ENABLE_GRPC
// --listen address
std::string listen_address = "127.0.0.1:50051";
#endif
std::vector<std::string> torrents;
std::vector<std::string> save_paths;
// torrent name
std::string legacy_torrent;
// storage to
std::string legacy_save_path;
};
#endif