diff options
Diffstat (limited to 'src/configuration.cpp')
| -rw-r--r-- | src/configuration.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
| diff --git a/src/configuration.cpp b/src/configuration.cpp index 0010a40..ed0ba8c 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp | |||
| @@ -4,18 +4,18 @@ | |||
| 4 | #include "codes.h" | 4 | #include "codes.h" |
| 5 | 5 | ||
| 6 | namespace twitter { | 6 | namespace twitter { |
| 7 | 7 | ||
| 8 | configuration::configuration(std::string data) try | 8 | configuration::configuration(std::string data) try |
| 9 | { | 9 | { |
| 10 | auto json_data = nlohmann::json::parse(data); | 10 | auto json_data = nlohmann::json::parse(data); |
| 11 | 11 | ||
| 12 | _characters_reserved_per_media = json_data["characters_reserved_per_media"].get<size_t>(); | 12 | _characters_reserved_per_media = json_data["characters_reserved_per_media"].get<size_t>(); |
| 13 | _dm_text_character_limit = json_data["dm_text_character_limit"].get<size_t>(); | 13 | _dm_text_character_limit = json_data["dm_text_character_limit"].get<size_t>(); |
| 14 | _max_media_per_upload = json_data["max_media_per_upload"].get<size_t>(); | 14 | _max_media_per_upload = json_data["max_media_per_upload"].get<size_t>(); |
| 15 | _photo_size_limit = json_data["photo_size_limit"].get<size_t>(); | 15 | _photo_size_limit = json_data["photo_size_limit"].get<size_t>(); |
| 16 | _short_url_length = json_data["short_url_length"].get<size_t>(); | 16 | _short_url_length = json_data["short_url_length"].get<size_t>(); |
| 17 | _short_https_url_length = json_data["short_url_length_https"].get<size_t>(); | 17 | _short_https_url_length = json_data["short_url_length_https"].get<size_t>(); |
| 18 | 18 | ||
| 19 | for (auto sizedata = std::begin(json_data["photo_sizes"]); sizedata != std::end(json_data["photo_sizes"]); ++sizedata) | 19 | for (auto sizedata = std::begin(json_data["photo_sizes"]); sizedata != std::end(json_data["photo_sizes"]); ++sizedata) |
| 20 | { | 20 | { |
| 21 | photosize size; | 21 | photosize size; |
| @@ -27,10 +27,10 @@ namespace twitter { | |||
| 27 | } else { | 27 | } else { |
| 28 | size.resize = resizetype::crop; | 28 | size.resize = resizetype::crop; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | _photo_sizes[sizedata.key()] = size; | 31 | _photo_sizes[sizedata.key()] = size; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | for (auto path : json_data["non_username_paths"]) | 34 | for (auto path : json_data["non_username_paths"]) |
| 35 | { | 35 | { |
| 36 | _non_username_paths.insert(path.get<std::string>()); | 36 | _non_username_paths.insert(path.get<std::string>()); |
