From aceb3cc33ee78cce1077252aff8a8808a3195ff1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 31 May 2016 09:55:58 -0400 Subject: Added ability to get configuration --- src/configuration.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/configuration.h (limited to 'src/configuration.h') 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 @@ +#ifndef CONFIGURATION_H_A7164D18 +#define CONFIGURATION_H_A7164D18 + +#include +#include +#include + +namespace twitter { + + class configuration { + public: + enum class resizetype { + fit, + crop + }; + + struct photosize { + size_t height; + size_t width; + resizetype resize; + }; + + configuration(); + configuration(std::string data); + + size_t getCharactersReservedPerMedia() const; + size_t getDirectMessageCharacterLimit() const; + size_t getMaxMediaPerUpload() const; + size_t getPhotoSizeLimit() const; + std::map getPhotoSizes() const; + size_t getShortUrlLength() const; + size_t getShortHttpsUrlLength() const; + std::set getNonUsernamePaths() const; + + operator bool() const; + + private: + bool _valid = false; + + size_t _characters_reserved_per_media; + size_t _dm_text_character_limit; + size_t _max_media_per_upload; + size_t _photo_size_limit; + std::map _photo_sizes; + size_t _short_url_length; + size_t _short_https_url_length; + std::set _non_username_paths; + }; + +}; + +#endif /* end of include guard: CONFIGURATION_H_A7164D18 */ -- cgit 1.4.1