diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-06-02 20:10:38 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2016-06-02 20:10:38 -0400 |
commit | 9fdcbee29350846db7f136b023da64bb2e6a93f5 (patch) | |
tree | 8fa6e2ee0e48c8b7310095989ef0a9838ddfcb37 /src/configuration.h | |
parent | e506eb6214ac1799ce7d7e333cfab965a11d5917 (diff) | |
parent | 442f1ee071152be04c4184473ddfee5040795b76 (diff) | |
download | libtwittercpp-9fdcbee29350846db7f136b023da64bb2e6a93f5.tar.gz libtwittercpp-9fdcbee29350846db7f136b023da64bb2e6a93f5.tar.bz2 libtwittercpp-9fdcbee29350846db7f136b023da64bb2e6a93f5.zip |
Merge branch 'master' of https://github.com/hatkirby/libtwittercpp
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 */ | ||