diff options
Diffstat (limited to 'src/configuration.h')
-rw-r--r-- | src/configuration.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/configuration.h b/src/configuration.h new file mode 100644 index 0000000..a15be3d --- /dev/null +++ b/src/configuration.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef CONFIGURATION_H_A7164D18 | ||
2 | #define CONFIGURATION_H_A7164D18 | ||
3 | |||
4 | #include <map> | ||
5 | #include <string> | ||
6 | #include <set> | ||
7 | |||
8 | namespace twitter { | ||
9 | |||
10 | class configuration { | ||
11 | public: | ||
12 | enum class resizetype { | ||
13 | fit, | ||
14 | crop | ||
15 | }; | ||
16 | |||
17 | struct photosize { | ||
18 | size_t height; | ||
19 | size_t width; | ||
20 | resizetype resize; | ||
21 | }; | ||
22 | |||
23 | configuration(); | ||
24 | configuration(std::string data); | ||
25 | |||
26 | size_t getCharactersReservedPerMedia() const; | ||
27 | size_t getDirectMessageCharacterLimit() const; | ||
28 | size_t getMaxMediaPerUpload() const; | ||
29 | size_t getPhotoSizeLimit() const; | ||
30 | std::map<std::string, photosize> getPhotoSizes() const; | ||
31 | size_t getShortUrlLength() const; | ||
32 | size_t getShortHttpsUrlLength() const; | ||
33 | std::set<std::string> getNonUsernamePaths() const; | ||
34 | |||
35 | operator bool() const; | ||
36 | |||
37 | private: | ||
38 | bool _valid = false; | ||
39 | |||
40 | size_t _characters_reserved_per_media; | ||
41 | size_t _dm_text_character_limit; | ||
42 | size_t _max_media_per_upload; | ||
43 | size_t _photo_size_limit; | ||
44 | std::map<std::string, photosize> _photo_sizes; | ||
45 | size_t _short_url_length; | ||
46 | size_t _short_https_url_length; | ||
47 | std::set<std::string> _non_username_paths; | ||
48 | }; | ||
49 | |||
50 | }; | ||
51 | |||
52 | #endif /* end of include guard: CONFIGURATION_H_A7164D18 */ | ||