Changed ids from uint_fast64_t to const string in all Entities.

This commit is contained in:
tastytea 2019-01-27 03:44:08 +01:00
parent e2614c045e
commit 0b47e0ec8d
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
18 changed files with 35 additions and 37 deletions

View File

@ -154,9 +154,9 @@ const string Account::header_static() const
return get_string("header_static");
}
std::uint_fast64_t Account::id() const
const string Account::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}
bool Account::locked() const

View File

@ -188,7 +188,7 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns true if the account is locked

View File

@ -139,9 +139,9 @@ uint_fast64_t Attachment::height_small() const
return get_uint64("meta.small.height");
}
std::uint_fast64_t Attachment::id() const
const string Attachment::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}
const string Attachment::preview_url() const

View File

@ -164,7 +164,7 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns the URL of the preview image

View File

@ -40,9 +40,9 @@ bool List::valid() const
return Entity::check_valid(attributes);
}
uint_fast64_t List::id() const
const string List::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}
const string List::title() const

View File

@ -66,7 +66,7 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns title

View File

@ -45,9 +45,9 @@ const string Mention::acct() const
return get_string("acct");
}
uint_fast64_t Mention::id() const
const string Mention::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}
const string Mention::url() const

View File

@ -73,7 +73,7 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns the URL of user's profile

View File

@ -58,7 +58,7 @@ const system_clock::time_point Notification::created_at() const
return get_time_point("created_at");
}
uint_fast64_t Notification::id() const
const string Notification::id() const
{
return stouint64(get_string("id"));
}

View File

@ -85,7 +85,7 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns the Status associated with the notification, if

View File

@ -23,9 +23,9 @@ PushSubscription::PushSubscription(const string &json)
: Entity(json)
{}
uint_fast64_t PushSubscription::id() const
const string PushSubscription::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}
PushSubscription::PushSubscription()

View File

@ -31,7 +31,6 @@
#endif
using std::string;
using std::uint_fast64_t;
namespace Mastodon
{
@ -66,7 +65,7 @@ namespace Mastodon
*
* @since 0.14.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns the endpoint URL

View File

@ -69,9 +69,9 @@ bool Relationship::following() const
return get_bool("following");
}
uint_fast64_t Relationship::id() const
const string Relationship::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}
bool Relationship::muting() const

View File

@ -100,7 +100,7 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns true if the user is muting the account

View File

@ -43,8 +43,8 @@ bool Report::action_taken() const
return get_bool("action_taken");
}
uint_fast64_t Report::id() const
const string Report::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}

View File

@ -30,7 +30,6 @@
#endif
using std::string;
using std::uint_fast64_t;
namespace Mastodon
{
@ -73,7 +72,7 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
};
}

View File

@ -127,25 +127,25 @@ uint_fast64_t Status::favourites_count() const
return get_uint64("favourites_count");
}
uint_fast64_t Status::id() const
const string Status::id() const
{
return stouint64(get_string("id"));
return get_string("id");
}
uint_fast64_t Status::in_reply_to_id() const
const string Status::in_reply_to_id() const
{
return stouint64(get_string("in_reply_to_id"));
return get_string("in_reply_to_id");
}
Status Status::in_reply_to_id(const uint_fast64_t &in_reply_to_id)
Status Status::in_reply_to_id(const string &in_reply_to_id)
{
set("in_reply_to_id", Json::Value(std::to_string(in_reply_to_id)));
set("in_reply_to_id", Json::Value(in_reply_to_id));
return *this;
}
uint_fast64_t Status::in_reply_to_account_id() const
const string Status::in_reply_to_account_id() const
{
return stouint64(get_string("in_reply_to_account_id"));
return get_string("in_reply_to_account_id");
}
const string Status::language() const

View File

@ -145,28 +145,28 @@ namespace Mastodon
*
* @since before 0.11.0
*/
uint_fast64_t id() const;
const string id() const;
/*!
* @brief Returns the ID of the status it replies to
*
* @since before 0.11.0
*/
uint_fast64_t in_reply_to_id() const;
const string in_reply_to_id() const;
/*!
* @brief Sets the ID of the status it replies to
*
* @since 0.17.0
*/
Status in_reply_to_id(const uint_fast64_t &in_reply_to_id);
Status in_reply_to_id(const string &in_reply_to_id);
/*!
* @brief Returns the ID of the account it replies to
*
* @since before 0.11.0
*/
uint_fast64_t in_reply_to_account_id() const;
const string in_reply_to_account_id() const;
/*!
* @brief Returns the language of the status