diff --git a/CMakeLists.txt b/CMakeLists.txt index b1e9334..e8e1daa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastodon-cpp - VERSION 0.7.14 + VERSION 0.7.15 LANGUAGES CXX ) diff --git a/src/easy/account.cpp b/src/easy/account.cpp index bf9b44a..92cde18 100644 --- a/src/easy/account.cpp +++ b/src/easy/account.cpp @@ -53,12 +53,12 @@ const string Account::display_name() const return get_string("display_name"); } -const std::uint64_t Account::followers_count() const +const std::uint_fast64_t Account::followers_count() const { return get_uint64("followers_count"); } -const std::uint64_t Account::following_count() const +const std::uint_fast64_t Account::following_count() const { return get_uint64("following_count"); } @@ -73,7 +73,7 @@ const string Account::header_static() const return get_string("header_static"); } -const std::uint64_t Account::id() const +const std::uint_fast64_t Account::id() const { return std::stoull(get_string("id")); } @@ -135,7 +135,7 @@ const bool Account::sensitive() const return get_bool("source.sensitive"); } -const std::uint64_t Account::statuses_count() const +const std::uint_fast64_t Account::statuses_count() const { return get_uint64("statuses_count"); } diff --git a/src/easy/account.hpp b/src/easy/account.hpp index 9727786..30559bc 100644 --- a/src/easy/account.hpp +++ b/src/easy/account.hpp @@ -31,7 +31,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; using std::chrono::system_clock; namespace Mastodon @@ -85,12 +85,12 @@ namespace Mastodon /*! * @brief Returns number of followers */ - const uint64_t followers_count() const; + const uint_fast64_t followers_count() const; /*! * @brief Returns number of people this account follows */ - const uint64_t following_count() const; + const uint_fast64_t following_count() const; /*! * @brief Returns URL of header image @@ -105,7 +105,7 @@ namespace Mastodon /*! * @brief Returns account-ID */ - const uint64_t id() const; + const uint_fast64_t id() const; /*! * @brief Returns true if the account is locked @@ -146,7 +146,7 @@ namespace Mastodon /*! * @brief Returns number of statuses */ - const uint64_t statuses_count() const; + const uint_fast64_t statuses_count() const; /*! * @brief Returns URL of the profile diff --git a/src/easy/attachment.cpp b/src/easy/attachment.cpp index e89a43d..461d527 100644 --- a/src/easy/attachment.cpp +++ b/src/easy/attachment.cpp @@ -44,7 +44,7 @@ const string Attachment::description() const return get_string("description"); } -const std::array Attachment::focus() const +const std::array Attachment::focus() const { const Json::Value x = get("meta.focus.x"); const Json::Value y = get("meta.focus.y"); @@ -60,17 +60,17 @@ const std::array Attachment::focus() const return {}; } -const uint64_t Attachment::height() const +const uint_fast64_t Attachment::height() const { return get_uint64("meta.original.height"); } -const uint64_t Attachment::height_small() const +const uint_fast64_t Attachment::height_small() const { return get_uint64("meta.small.height"); } -const std::uint64_t Attachment::id() const +const std::uint_fast64_t Attachment::id() const { return std::stoull(get_string("id")); } @@ -121,12 +121,12 @@ const string Attachment::url() const return get_string("url"); } -const uint64_t Attachment::width() const +const uint_fast64_t Attachment::width() const { return get_uint64("meta.original.width"); } -const uint64_t Attachment::width_small() const +const uint_fast64_t Attachment::width_small() const { return get_uint64("meta.small.width"); } diff --git a/src/easy/attachment.hpp b/src/easy/attachment.hpp index 3f39d1f..a6b4524 100644 --- a/src/easy/attachment.hpp +++ b/src/easy/attachment.hpp @@ -33,7 +33,7 @@ using std::string; using std::uint16_t; -using std::uint64_t; +using std::uint_fast64_t; namespace Mastodon { @@ -74,22 +74,22 @@ namespace Mastodon * @brief Returns the focus point (x, y) */ // TODO: find attachment with focus - const std::array focus() const; + const std::array focus() const; /*! * @brief Returns the height of the original image */ - const uint64_t height() const; + const uint_fast64_t height() const; /*! * @brief Returns the height of the preview image */ - const uint64_t height_small() const; + const uint_fast64_t height_small() const; /*! * @brief Returns the ID of the attachment */ - const uint64_t id() const; + const uint_fast64_t id() const; /*! * @brief Returns the URL of the preview image @@ -129,18 +129,18 @@ namespace Mastodon /*! * @brief Returns the width of the original image */ - const uint64_t width() const; + const uint_fast64_t width() const; /*! * @brief Returns the width of the preview image */ - const uint64_t width_small() const; + const uint_fast64_t width_small() const; // TODO: find an attachment with framerate, duration or bitrate set // const uint16_t framerate() const; // const std::chrono::seconds duration() const; - // const uint64_t bitrate() const; + // const uint_fast64_t bitrate() const; }; } diff --git a/src/easy/card.cpp b/src/easy/card.cpp index 86f0df4..306baaa 100644 --- a/src/easy/card.cpp +++ b/src/easy/card.cpp @@ -43,7 +43,7 @@ const string Card::description() const return get_string("description"); } -const uint64_t Card::height() const +const uint_fast64_t Card::height() const { return get_uint64("height"); } @@ -94,7 +94,7 @@ const string Card::url() const return get_string("url"); } -const uint64_t Card::width() const +const uint_fast64_t Card::width() const { return get_uint64("width"); } diff --git a/src/easy/card.hpp b/src/easy/card.hpp index 40bf49c..5b5036e 100644 --- a/src/easy/card.hpp +++ b/src/easy/card.hpp @@ -30,7 +30,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; namespace Mastodon { @@ -70,7 +70,7 @@ namespace Mastodon /*! * @brief Returns the height of the card */ - const uint64_t height() const; + const uint_fast64_t height() const; /*! * @brief Returns the HTML @@ -110,7 +110,7 @@ namespace Mastodon /*! * @brief Returns the width of the card */ - const uint64_t width() const; + const uint_fast64_t width() const; }; } diff --git a/src/easy/easy.cpp b/src/easy/easy.cpp index 477d25e..43d4668 100644 --- a/src/easy/easy.cpp +++ b/src/easy/easy.cpp @@ -22,7 +22,7 @@ using namespace Mastodon; using std::string; -using std::uint64_t; +using std::uint_fast64_t; using std::chrono::system_clock; Easy::Easy(const string &instance, const string &access_token) @@ -124,7 +124,7 @@ const string Easy::Entity::get_string(const string &key) const return ""; } -const uint64_t Easy::Entity::get_uint64(const string &key) const +const uint_fast64_t Easy::Entity::get_uint64(const string &key) const { const Json::Value node = get(key); diff --git a/src/easy/easy.hpp b/src/easy/easy.hpp index b3d0cf6..e57cd14 100644 --- a/src/easy/easy.hpp +++ b/src/easy/easy.hpp @@ -31,7 +31,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; using std::chrono::system_clock; namespace Mastodon @@ -147,11 +147,11 @@ public: const string get_string(const string &key) const; /*! - * @brief Returns the value of key as std::uint64_t + * @brief Returns the value of key as std::uint_fast64_t * * Returns 0 on error. */ - const uint64_t get_uint64(const string &key) const; + const uint_fast64_t get_uint64(const string &key) const; /*! * @brief Returns the value of key as double diff --git a/src/easy/list.cpp b/src/easy/list.cpp index a148a35..9b0e413 100644 --- a/src/easy/list.cpp +++ b/src/easy/list.cpp @@ -19,7 +19,7 @@ using namespace Mastodon; using List = Easy::List; using std::string; -using std::uint64_t; +using std::uint_fast64_t; List::List(const string &json) : Entity(json) @@ -29,7 +29,7 @@ List::List() : Entity() {} -const uint64_t List::id() const +const uint_fast64_t List::id() const { return std::stoull(get_string("id")); } diff --git a/src/easy/list.hpp b/src/easy/list.hpp index 2e8a5e3..654cbda 100644 --- a/src/easy/list.hpp +++ b/src/easy/list.hpp @@ -31,7 +31,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; namespace Mastodon { @@ -56,7 +56,7 @@ namespace Mastodon /*! * @brief Returns list-ID */ - const uint64_t id() const; + const uint_fast64_t id() const; /*! * @brief Returns title diff --git a/src/easy/mention.cpp b/src/easy/mention.cpp index fe8be65..ba90b58 100644 --- a/src/easy/mention.cpp +++ b/src/easy/mention.cpp @@ -32,7 +32,7 @@ const string Mention::acct() const return get_string("acct"); } -const uint64_t Mention::id() const +const uint_fast64_t Mention::id() const { return std::stoull(get_string("id")); } diff --git a/src/easy/mention.hpp b/src/easy/mention.hpp index 95cd7dc..9865b16 100644 --- a/src/easy/mention.hpp +++ b/src/easy/mention.hpp @@ -30,7 +30,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; using std::chrono::system_clock; namespace Mastodon @@ -61,7 +61,7 @@ namespace Mastodon /*! * @brief Returns account ID */ - const uint64_t id() const; + const uint_fast64_t id() const; /*! * @brief Returns the URL of user's profile diff --git a/src/easy/notification.cpp b/src/easy/notification.cpp index 856ad87..af5234b 100644 --- a/src/easy/notification.cpp +++ b/src/easy/notification.cpp @@ -45,7 +45,7 @@ const system_clock::time_point Notification::created_at() const return get_time_point("created_at"); } -const uint64_t Notification::id() const +const uint_fast64_t Notification::id() const { return std::stoull(get_string("id")); } diff --git a/src/easy/notification.hpp b/src/easy/notification.hpp index ab5ff44..c9db8b7 100644 --- a/src/easy/notification.hpp +++ b/src/easy/notification.hpp @@ -35,7 +35,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; using std::chrono::system_clock; namespace Mastodon @@ -71,7 +71,7 @@ namespace Mastodon /*! * @brief Returns notification ID */ - const uint64_t id() const; + const uint_fast64_t id() const; /*! * @brief Returns the Status associated with the notification, if diff --git a/src/easy/relationship.cpp b/src/easy/relationship.cpp index a80a5a4..45a7b9a 100644 --- a/src/easy/relationship.cpp +++ b/src/easy/relationship.cpp @@ -47,7 +47,7 @@ const bool Relationship::following() const return get_bool("following"); } -const uint64_t Relationship::id() const +const uint_fast64_t Relationship::id() const { return std::stoull(get_string("id")); } diff --git a/src/easy/relationship.hpp b/src/easy/relationship.hpp index cb68afc..72402c7 100644 --- a/src/easy/relationship.hpp +++ b/src/easy/relationship.hpp @@ -30,7 +30,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; namespace Mastodon { @@ -75,7 +75,7 @@ namespace Mastodon /*! * @brief Returns the target account ID */ - const uint64_t id() const; + const uint_fast64_t id() const; /*! * @brief Returns true if the user is muting the account diff --git a/src/easy/report.cpp b/src/easy/report.cpp index 84f0e3d..3fe79fe 100644 --- a/src/easy/report.cpp +++ b/src/easy/report.cpp @@ -32,7 +32,7 @@ const bool Report::action_taken() const return get_bool("action_taken"); } -const uint64_t Report::id() const +const uint_fast64_t Report::id() const { return std::stoull(get_string("id")); } diff --git a/src/easy/report.hpp b/src/easy/report.hpp index c18a596..93905cb 100644 --- a/src/easy/report.hpp +++ b/src/easy/report.hpp @@ -30,7 +30,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; namespace Mastodon { @@ -61,7 +61,7 @@ namespace Mastodon /*! * @brief Returns the ID of the report */ - const uint64_t id() const; + const uint_fast64_t id() const; }; } diff --git a/src/easy/status.cpp b/src/easy/status.cpp index 58e62fb..4e723bf 100644 --- a/src/easy/status.cpp +++ b/src/easy/status.cpp @@ -85,22 +85,22 @@ const bool Status::favourited() const return get_bool("favourited"); } -const uint64_t Status::favourites_count() const +const uint_fast64_t Status::favourites_count() const { return get_uint64("favourites_count"); } -const uint64_t Status::id() const +const uint_fast64_t Status::id() const { return get_uint64("id"); } -const uint64_t Status::in_reply_to_id() const +const uint_fast64_t Status::in_reply_to_id() const { return get_uint64("in_reply_to_id"); } -const uint64_t Status::in_reply_to_account_id() const +const uint_fast64_t Status::in_reply_to_account_id() const { return get_uint64("in_reply_to_account_id"); } @@ -171,7 +171,7 @@ const bool Status::reblogged() const return get_bool("reblogged"); } -const uint64_t Status::reblogs_count() const +const uint_fast64_t Status::reblogs_count() const { return get_uint64("reblogs_count"); } diff --git a/src/easy/status.hpp b/src/easy/status.hpp index 26b5ecb..e842a86 100644 --- a/src/easy/status.hpp +++ b/src/easy/status.hpp @@ -44,7 +44,7 @@ #endif using std::string; -using std::uint64_t; +using std::uint_fast64_t; using std::chrono::system_clock; namespace Mastodon @@ -100,22 +100,22 @@ namespace Mastodon /*! * @brief Returns the number of favourites */ - const uint64_t favourites_count() const; + const uint_fast64_t favourites_count() const; /*! * @brief Returns the ID of the status */ - const uint64_t id() const; + const uint_fast64_t id() const; /*! * @brief Returns the ID of the status it replies to */ - const uint64_t in_reply_to_id() const; + const uint_fast64_t in_reply_to_id() const; /*! * @brief Returns the ID of the account it replies to */ - const uint64_t in_reply_to_account_id() const; + const uint_fast64_t in_reply_to_account_id() const; /*! * @brief Returns the language of the status @@ -155,7 +155,7 @@ namespace Mastodon /*! * @brief Returns the number of reblogs for the status */ - const uint64_t reblogs_count() const; + const uint_fast64_t reblogs_count() const; /*! * @brief Returns true if the attachments should be hidden by default