Removed const where it has no effect.
the build was successful Details

This commit is contained in:
tastytea 2018-12-04 11:26:28 +01:00
parent 8a0f709a6e
commit ee82d35357
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
44 changed files with 379 additions and 379 deletions

View File

@ -20,8 +20,8 @@
using namespace Mastodon; using namespace Mastodon;
const uint_fast16_t API::del(const Mastodon::API::v1 &call, uint_fast16_t API::del(const Mastodon::API::v1 &call,
const parametermap &parameters) const parametermap &parameters)
{ {
string strcall = ""; string strcall = "";
string strid = ""; string strid = "";
@ -60,8 +60,8 @@ const uint_fast16_t API::del(const Mastodon::API::v1 &call,
return del(strcall, parameters, answer); return del(strcall, parameters, answer);
} }
const uint_fast16_t API::del(const std::string &call, uint_fast16_t API::del(const std::string &call,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
return _http.request(http::method::DELETE, call, return _http.request(http::method::DELETE, call,
@ -71,16 +71,16 @@ const uint_fast16_t API::del(const std::string &call,
// ↓↓ DEPRECATED ↓↓ // ↓↓ DEPRECATED ↓↓
const uint_fast16_t API::del(const Mastodon::API::v1 &call, uint_fast16_t API::del(const Mastodon::API::v1 &call,
const string &argument) const string &argument)
{ {
const parametermap p = {}; const parametermap p = {};
return del(call, argument, p); return del(call, argument, p);
} }
const uint_fast16_t API::del(const Mastodon::API::v1 &call, uint_fast16_t API::del(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters) const parametermap &parameters)
{ {
parametermap newparameters = parameters; parametermap newparameters = parameters;

View File

@ -21,8 +21,8 @@
using namespace Mastodon; using namespace Mastodon;
using std::cerr; using std::cerr;
const uint_fast16_t API::get(const Mastodon::API::v1 &call, uint_fast16_t API::get(const Mastodon::API::v1 &call,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
string strcall = ""; string strcall = "";
string strid = ""; string strid = "";
@ -168,8 +168,8 @@ const uint_fast16_t API::get(const Mastodon::API::v1 &call,
return get(strcall, answer); return get(strcall, answer);
} }
const uint_fast16_t API::get(const Mastodon::API::v2 &call, uint_fast16_t API::get(const Mastodon::API::v2 &call,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
string strcall = ""; string strcall = "";
string strid = ""; string strid = "";
@ -204,13 +204,13 @@ const uint_fast16_t API::get(const Mastodon::API::v2 &call,
return get(strcall, answer); return get(strcall, answer);
} }
const uint_fast16_t API::get(const Mastodon::API::v1 &call, string &answer) uint_fast16_t API::get(const Mastodon::API::v1 &call, string &answer)
{ {
const parametermap p; const parametermap p;
return get(call, p, answer); return get(call, p, answer);
} }
const uint_fast16_t API::get(const std::string &call, string &answer) uint_fast16_t API::get(const std::string &call, string &answer)
{ {
return _http.request(http::method::GET, call, answer); return _http.request(http::method::GET, call, answer);
} }
@ -219,9 +219,9 @@ const uint_fast16_t API::get(const std::string &call, string &answer)
// ↓↓ DEPRECATED ↓↓ // ↓↓ DEPRECATED ↓↓
const uint_fast16_t API::get(const Mastodon::API::v1 &call, uint_fast16_t API::get(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
parametermap newparameters = parameters; parametermap newparameters = parameters;
@ -243,8 +243,8 @@ const uint_fast16_t API::get(const Mastodon::API::v1 &call,
return get(call, newparameters, answer); return get(call, newparameters, answer);
} }
const uint_fast16_t API::get(const Mastodon::API::v1 &call, uint_fast16_t API::get(const Mastodon::API::v1 &call,
const string &argument, string &answer) const string &argument, string &answer)
{ {
const parametermap p; const parametermap p;
return get(call, argument, p, answer); return get(call, argument, p, answer);

View File

@ -21,10 +21,10 @@
using namespace Mastodon; using namespace Mastodon;
using std::cerr; using std::cerr;
const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call, uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer, string &answer,
std::unique_ptr<Mastodon::API::http> &ptr) std::unique_ptr<Mastodon::API::http> &ptr)
{ {
string strcall = ""; string strcall = "";
@ -59,16 +59,16 @@ const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
return get_stream(strcall, answer, ptr); return get_stream(strcall, answer, ptr);
} }
const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call, uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
string &answer, string &answer,
std::unique_ptr<Mastodon::API::http> &ptr) std::unique_ptr<Mastodon::API::http> &ptr)
{ {
parametermap p = {}; parametermap p = {};
return get_stream(call, p, answer, ptr); return get_stream(call, p, answer, ptr);
} }
const uint_fast16_t API::get_stream(const std::string &call, string &answer, uint_fast16_t API::get_stream(const std::string &call, string &answer,
std::unique_ptr<http> &ptr) std::unique_ptr<http> &ptr)
{ {
ptr = std::make_unique<http>(*this, _instance, _access_token); ptr = std::make_unique<http>(*this, _instance, _access_token);
return ptr->request(http::method::GET_STREAM, call, answer); return ptr->request(http::method::GET_STREAM, call, answer);
@ -77,10 +77,10 @@ const uint_fast16_t API::get_stream(const std::string &call, string &answer,
// ↓↓ DEPRECATED ↓↓ // ↓↓ DEPRECATED ↓↓
const uint_fast16_t API::get_stream(const Mastodon::API::v1 &call, uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
string &answer, string &answer,
std::unique_ptr<Mastodon::API::http> &ptr) std::unique_ptr<Mastodon::API::http> &ptr)
{ {
parametermap parameters; parametermap parameters;

View File

@ -21,9 +21,9 @@
using namespace Mastodon; using namespace Mastodon;
using std::cerr; using std::cerr;
const uint_fast16_t API::patch(const Mastodon::API::v1 &call, uint_fast16_t API::patch(const Mastodon::API::v1 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer) string &answer)
{ {
string strcall = ""; string strcall = "";
switch (call) switch (call)

View File

@ -20,8 +20,8 @@
using namespace Mastodon; using namespace Mastodon;
const uint_fast16_t API::post(const Mastodon::API::v1 &call, uint_fast16_t API::post(const Mastodon::API::v1 &call,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
string strcall = ""; string strcall = "";
string strid = ""; string strid = "";
@ -137,14 +137,14 @@ const uint_fast16_t API::post(const Mastodon::API::v1 &call,
return post(strcall, parameters, answer); return post(strcall, parameters, answer);
} }
const uint_fast16_t API::post(const Mastodon::API::v1 &call, string &answer) uint_fast16_t API::post(const Mastodon::API::v1 &call, string &answer)
{ {
const parametermap p; const parametermap p;
return post(call, p, answer); return post(call, p, answer);
} }
const uint_fast16_t API::post(const string &call, uint_fast16_t API::post(const string &call,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
return _http.request(http::method::POST, call, return _http.request(http::method::POST, call,
@ -154,9 +154,9 @@ const uint_fast16_t API::post(const string &call,
// ↓↓ DEPRECATED ↓↓ // ↓↓ DEPRECATED ↓↓
const uint_fast16_t API::post(const Mastodon::API::v1 &call, uint_fast16_t API::post(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
parametermap newparameters = parameters; parametermap newparameters = parameters;
@ -166,8 +166,8 @@ const uint_fast16_t API::post(const Mastodon::API::v1 &call,
return post(call, newparameters, answer); return post(call, newparameters, answer);
} }
const uint_fast16_t API::post(const Mastodon::API::v1 &call, uint_fast16_t API::post(const Mastodon::API::v1 &call,
const string &argument, string &answer) const string &argument, string &answer)
{ {
const parametermap p; const parametermap p;
return post(call, argument, p, answer); return post(call, argument, p, answer);

View File

@ -20,8 +20,8 @@
using namespace Mastodon; using namespace Mastodon;
const uint_fast16_t API::put(const Mastodon::API::v1 &call, uint_fast16_t API::put(const Mastodon::API::v1 &call,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
string strcall = ""; string strcall = "";
string strid = ""; string strid = "";
@ -53,8 +53,8 @@ const uint_fast16_t API::put(const Mastodon::API::v1 &call,
return put(strcall, parameters, answer); return put(strcall, parameters, answer);
} }
const uint_fast16_t API::put(const string &call, uint_fast16_t API::put(const string &call,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
return _http.request(http::method::PUT, call, return _http.request(http::method::PUT, call,
@ -63,9 +63,9 @@ const uint_fast16_t API::put(const string &call,
// ↓↓ DEPRECATED ↓↓ // ↓↓ DEPRECATED ↓↓
const uint_fast16_t API::put(const Mastodon::API::v1 &call, uint_fast16_t API::put(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters, string &answer) const parametermap &parameters, string &answer)
{ {
parametermap newparameters = parameters; parametermap newparameters = parameters;

View File

@ -133,22 +133,22 @@ Easy::Link::Link(const string &link_header)
} }
} }
const uint_fast64_t Easy::Link::next() const uint_fast64_t Easy::Link::next() const
{ {
return _next; return _next;
} }
const uint_fast64_t Easy::Link::max_id() const uint_fast64_t Easy::Link::max_id() const
{ {
return _next; return _next;
} }
const uint_fast64_t Easy::Link::prev() const uint_fast64_t Easy::Link::prev() const
{ {
return _prev; return _prev;
} }
const uint_fast64_t Easy::Link::since_id() const uint_fast64_t Easy::Link::since_id() const
{ {
return _prev; return _prev;
} }

View File

@ -171,28 +171,28 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t next() const; uint_fast64_t next() const;
/*! /*!
* @brief Returns max_id * @brief Returns max_id
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t max_id() const; uint_fast64_t max_id() const;
/*! /*!
* @brief Returns since_id * @brief Returns since_id
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t prev() const; uint_fast64_t prev() const;
/*! /*!
* @brief Returns since_id * @brief Returns since_id
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t since_id() const; uint_fast64_t since_id() const;
private: private:
uint_fast64_t _next; uint_fast64_t _next;
@ -327,7 +327,7 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const void from_string(const string &json); void from_string(const string &json);
/*! /*!
* @brief Returns the JSON object of the Entity * @brief Returns the JSON object of the Entity
@ -343,7 +343,7 @@ public:
* *
* @since before 0.11.0 (virtual since 0.18.2) * @since before 0.11.0 (virtual since 0.18.2)
*/ */
virtual const bool valid() const = 0; virtual bool valid() const = 0;
/*! /*!
* @brief Returns error string sent by the server * @brief Returns error string sent by the server
@ -380,7 +380,7 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool was_set() const; bool was_set() const;
protected: protected:
/*! /*!
@ -403,14 +403,14 @@ public:
* *
* Returns 0 if the value does not exist or is null. * Returns 0 if the value does not exist or is null.
*/ */
const uint_fast64_t get_uint64(const string &key) const; uint_fast64_t get_uint64(const string &key) const;
/*! /*!
* @brief Returns the value of key as double * @brief Returns the value of key as double
* *
* Returns 0.0 if the value does not exist or is null. * Returns 0.0 if the value does not exist or is null.
*/ */
const double get_double(const string &key) const; double get_double(const string &key) const;
// TODO: Maybe an enum would be better? // TODO: Maybe an enum would be better?
/*! /*!
@ -418,7 +418,7 @@ public:
* *
* Returns false if the value does not exist or is null. * Returns false if the value does not exist or is null.
*/ */
const bool get_bool(const string &key) const; bool get_bool(const string &key) const;
/*! /*!
* @brief Returns the value of key as time_point * @brief Returns the value of key as time_point
@ -440,9 +440,9 @@ public:
* *
* @since 0.17.0 * @since 0.17.0
*/ */
const void set(const string &key, const Json::Value &value); void set(const string &key, const Json::Value &value);
const std::uint_fast64_t stouint64(const string &str) const; std::uint_fast64_t stouint64(const string &str) const;
/*! /*!
* @brief Checks if an Entity is valid * @brief Checks if an Entity is valid
@ -453,8 +453,7 @@ public:
* *
* @since 0.18.2 * @since 0.18.2
*/ */
const bool bool check_valid(const std::vector<string> &attributes) const;
check_valid(const std::vector<string> &attributes) const;
private: private:
Json::Value _tree; Json::Value _tree;

View File

@ -29,7 +29,7 @@ Account::Account()
: Entity() : Entity()
{} {}
const bool Account::valid() const bool Account::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -74,7 +74,7 @@ const string Account::avatar_static() const
return get_string("avatar_static"); return get_string("avatar_static");
} }
const bool Account::bot() const bool Account::bot() const
{ {
return get_bool("bot"); return get_bool("bot");
} }
@ -128,12 +128,12 @@ Account Account::fields(std::vector<Account::fields_pair> &fields)
return *this; return *this;
} }
const std::uint_fast64_t Account::followers_count() const std::uint_fast64_t Account::followers_count() const
{ {
return get_uint64("followers_count"); return get_uint64("followers_count");
} }
const std::uint_fast64_t Account::following_count() const std::uint_fast64_t Account::following_count() const
{ {
return get_uint64("following_count"); return get_uint64("following_count");
} }
@ -154,12 +154,12 @@ const string Account::header_static() const
return get_string("header_static"); return get_string("header_static");
} }
const std::uint_fast64_t Account::id() const std::uint_fast64_t Account::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }
const bool Account::locked() const bool Account::locked() const
{ {
return get_bool("locked"); return get_bool("locked");
} }
@ -170,7 +170,7 @@ Account Account::locked(const bool &locked)
return *this; return *this;
} }
const bool Account::has_moved() const bool Account::has_moved() const
{ {
if (get("moved").isObject()) if (get("moved").isObject())
{ {
@ -207,7 +207,7 @@ const string Account::note_plain() const
return get_string("source.note"); return get_string("source.note");
} }
const Easy::visibility_type Account::privacy() const Easy::visibility_type Account::privacy() const
{ {
const string strprivacy = get_string("source.privacy"); const string strprivacy = get_string("source.privacy");
if (strprivacy.compare("public") == 0) if (strprivacy.compare("public") == 0)
@ -223,7 +223,7 @@ const Easy::visibility_type Account::privacy() const
return visibility_type::Undefined; return visibility_type::Undefined;
} }
const bool Account::sensitive() const bool Account::sensitive() const
{ {
return get_bool("source.sensitive"); return get_bool("source.sensitive");
} }
@ -236,7 +236,7 @@ Account::Source::Source()
: Entity() : Entity()
{} {}
const bool Account::Source::valid() const bool Account::Source::valid() const
{ {
return true; return true;
} }
@ -286,7 +286,7 @@ Account::Source Account::Source::note(const string &note)
return *this; return *this;
} }
const Easy::visibility_type Account::Source::privacy() const Easy::visibility_type Account::Source::privacy() const
{ {
const string strprivacy = get_string("privacy"); const string strprivacy = get_string("privacy");
if (strprivacy.compare("public") == 0) if (strprivacy.compare("public") == 0)
@ -337,7 +337,7 @@ Account::Source Account::Source::privacy(const Easy::visibility_type &privacy)
return *this; return *this;
} }
const bool Account::Source::sensitive() const bool Account::Source::sensitive() const
{ {
return get_bool("sensitive"); return get_bool("sensitive");
} }
@ -359,7 +359,7 @@ Account Account::source(const Account::Source &source)
return *this; return *this;
} }
const std::uint_fast64_t Account::statuses_count() const std::uint_fast64_t Account::statuses_count() const
{ {
return get_uint64("statuses_count"); return get_uint64("statuses_count");
} }

View File

@ -69,7 +69,7 @@ namespace Mastodon
*/ */
Account(); Account();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns username * @brief Returns username
@ -109,7 +109,7 @@ namespace Mastodon
* *
* @since 0.16.0 * @since 0.16.0
*/ */
const bool bot() const; bool bot() const;
/*! /*!
* @brief Returns time of creation * @brief Returns time of creation
@ -151,14 +151,14 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t followers_count() const; uint_fast64_t followers_count() const;
/*! /*!
* @brief Returns number of people this account follows * @brief Returns number of people this account follows
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t following_count() const; uint_fast64_t following_count() const;
/*! /*!
* @brief Returns URL of header image * @brief Returns URL of header image
@ -188,14 +188,14 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
/*! /*!
* @brief Returns true if the account is locked * @brief Returns true if the account is locked
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool locked() const; bool locked() const;
/*! /*!
* @brief Sets locked state * @brief Sets locked state
@ -209,7 +209,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool has_moved() const; bool has_moved() const;
/*! /*!
* @brief If the owner decided to switch accounts, new account is in * @brief If the owner decided to switch accounts, new account is in
@ -246,14 +246,14 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const visibility_type privacy() const; visibility_type privacy() const;
/*! /*!
* @brief Returns if media is marked as sensitive by default * @brief Returns if media is marked as sensitive by default
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool sensitive() const; bool sensitive() const;
/*! /*!
* @brief Class to hold source attribute * @brief Class to hold source attribute
@ -279,7 +279,7 @@ namespace Mastodon
*/ */
Source(); Source();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns metadata fields * @brief Returns metadata fields
@ -314,7 +314,7 @@ namespace Mastodon
* *
* @since 0.18.5 * @since 0.18.5
*/ */
const visibility_type privacy() const; visibility_type privacy() const;
/*! /*!
* @brief Sets default privacy of new toots * @brief Sets default privacy of new toots
@ -328,7 +328,7 @@ namespace Mastodon
* *
* @since 0.18.5 * @since 0.18.5
*/ */
const bool sensitive() const; bool sensitive() const;
/*! /*!
* @brief Sets if media is marked as sensitive by default * @brief Sets if media is marked as sensitive by default
@ -346,7 +346,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t statuses_count() const; uint_fast64_t statuses_count() const;
/*! /*!
* @brief Returns URL of the profile * @brief Returns URL of the profile

View File

@ -27,7 +27,7 @@ Application::Application()
: Entity() : Entity()
{} {}
const bool Application::valid() const bool Application::valid() const
{ {
return Entity::check_valid({"name"}); return Entity::check_valid({"name"});
} }

View File

@ -56,7 +56,7 @@ namespace Mastodon
*/ */
Application(); Application();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the name of the application * @brief Returns the name of the application

View File

@ -29,7 +29,7 @@ Attachment::Attachment()
: Entity() : Entity()
{} {}
const bool Attachment::valid() const bool Attachment::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -42,17 +42,17 @@ const bool Attachment::valid() const
return Entity::check_valid(attributes); return Entity::check_valid(attributes);
} }
const double Attachment::aspect() const double Attachment::aspect() const
{ {
return get_double("meta.original.aspect"); return get_double("meta.original.aspect");
} }
const double Attachment::aspect_small() const double Attachment::aspect_small() const
{ {
return get_double("meta.small.aspect"); return get_double("meta.small.aspect");
} }
const uint_fast64_t Attachment::bitrate() const uint_fast64_t Attachment::bitrate() const
{ {
return get_uint64("meta.original.bitrate"); return get_uint64("meta.original.bitrate");
} }
@ -110,7 +110,7 @@ Attachment Attachment::focus(const std::array<double, 2> &focus)
return *this; return *this;
} }
const double Attachment::framerate() const double Attachment::framerate() const
{ {
string strframes = get_string("meta.original.frame_rate"); string strframes = get_string("meta.original.frame_rate");
@ -129,17 +129,17 @@ const double Attachment::framerate() const
return 0.0; return 0.0;
} }
const uint_fast64_t Attachment::height() const uint_fast64_t Attachment::height() const
{ {
return get_uint64("meta.original.height"); return get_uint64("meta.original.height");
} }
const uint_fast64_t Attachment::height_small() const uint_fast64_t Attachment::height_small() const
{ {
return get_uint64("meta.small.height"); return get_uint64("meta.small.height");
} }
const std::uint_fast64_t Attachment::id() const std::uint_fast64_t Attachment::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }
@ -169,7 +169,7 @@ const string Attachment::text_url() const
return get_string("text_url"); return get_string("text_url");
} }
const Easy::attachment_type Attachment::type() const Easy::attachment_type Attachment::type() const
{ {
const string strtype = get_string("type"); const string strtype = get_string("type");
if (strtype.compare("image") == 0) if (strtype.compare("image") == 0)
@ -190,12 +190,12 @@ const string Attachment::url() const
return get_string("url"); return get_string("url");
} }
const uint_fast64_t Attachment::width() const uint_fast64_t Attachment::width() const
{ {
return get_uint64("meta.original.width"); return get_uint64("meta.original.width");
} }
const uint_fast64_t Attachment::width_small() const uint_fast64_t Attachment::width_small() const
{ {
return get_uint64("meta.small.width"); return get_uint64("meta.small.width");
} }

View File

@ -60,28 +60,28 @@ namespace Mastodon
*/ */
Attachment(); Attachment();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Aspect of original image * @brief Aspect of original image
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const double aspect() const; double aspect() const;
/*! /*!
* @brief Aspect of preview image * @brief Aspect of preview image
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const double aspect_small() const; double aspect_small() const;
/*! /*!
* @brief Returns the bitrate of a video * @brief Returns the bitrate of a video
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t bitrate() const; uint_fast64_t bitrate() const;
/*! /*!
* @brief Returns the image description * @brief Returns the image description
@ -143,28 +143,28 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const double framerate() const; double framerate() const;
/*! /*!
* @brief Returns the height of the original image * @brief Returns the height of the original image
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t height() const; uint_fast64_t height() const;
/*! /*!
* @brief Returns the height of the preview image * @brief Returns the height of the preview image
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t height_small() const; uint_fast64_t height_small() const;
/*! /*!
* @brief Returns the ID of the attachment * @brief Returns the ID of the attachment
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
/*! /*!
* @brief Returns the URL of the preview image * @brief Returns the URL of the preview image
@ -206,7 +206,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const attachment_type type() const; attachment_type type() const;
/*! /*!
* @brief Returns URL of the locally hosted version of the image * @brief Returns URL of the locally hosted version of the image
@ -220,14 +220,14 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t width() const; uint_fast64_t width() const;
/*! /*!
* @brief Returns the width of the preview image * @brief Returns the width of the preview image
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t width_small() const; uint_fast64_t width_small() const;
}; };

View File

@ -28,7 +28,7 @@ Card::Card()
: Entity() : Entity()
{} {}
const bool Card::valid() const bool Card::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -56,7 +56,7 @@ const string Card::description() const
return get_string("description"); return get_string("description");
} }
const uint_fast64_t Card::height() const uint_fast64_t Card::height() const
{ {
return get_uint64("height"); return get_uint64("height");
} }
@ -86,7 +86,7 @@ const string Card::title() const
return get_string("title"); return get_string("title");
} }
const Easy::card_type Card::type() const Easy::card_type Card::type() const
{ {
const string strtype = get_string("type"); const string strtype = get_string("type");
if (strtype.compare("link") == 0) if (strtype.compare("link") == 0)
@ -107,7 +107,7 @@ const string Card::url() const
return get_string("url"); return get_string("url");
} }
const uint_fast64_t Card::width() const uint_fast64_t Card::width() const
{ {
return get_uint64("width"); return get_uint64("width");
} }

View File

@ -58,7 +58,7 @@ namespace Mastodon
*/ */
Card(); Card();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the name of the author * @brief Returns the name of the author
@ -86,7 +86,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t height() const; uint_fast64_t height() const;
/*! /*!
* @brief Returns the HTML * @brief Returns the HTML
@ -128,7 +128,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const Easy::card_type type() const; Easy::card_type type() const;
/*! /*!
* @brief Returns the URL associated with the card * @brief Returns the URL associated with the card
@ -142,7 +142,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t width() const; uint_fast64_t width() const;
}; };
} }

View File

@ -28,7 +28,7 @@ Context::Context()
: Entity() : Entity()
{} {}
const bool Context::valid() const bool Context::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{

View File

@ -59,7 +59,7 @@ namespace Mastodon
*/ */
Context(); Context();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the ancestors of the Status as vector of Statuses * @brief Returns the ancestors of the Status as vector of Statuses

View File

@ -28,7 +28,7 @@ Emoji::Emoji()
: Entity() : Entity()
{} {}
const bool Emoji::valid() const bool Emoji::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{

View File

@ -56,7 +56,7 @@ namespace Mastodon
*/ */
Emoji(); Emoji();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the shortcode of the emoji * @brief Returns the shortcode of the emoji

View File

@ -30,7 +30,7 @@ Instance::Instance()
: Entity() : Entity()
{} {}
const bool Instance::valid() const bool Instance::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -94,7 +94,7 @@ const string Instance::streaming_api() const
return get_string("urls.streaming_api"); return get_string("urls.streaming_api");
} }
const uint_fast64_t Instance::max_toot_chars() const uint_fast64_t Instance::max_toot_chars() const
{ {
const uint_fast64_t max_chars = get_uint64("max_toot_chars"); const uint_fast64_t max_chars = get_uint64("max_toot_chars");
if (was_set()) if (was_set())

View File

@ -61,7 +61,7 @@ namespace Mastodon
*/ */
Instance(); Instance();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the Account of the admin or another contact person * @brief Returns the Account of the admin or another contact person
@ -129,7 +129,7 @@ namespace Mastodon
* *
* @since 0.20.0 * @since 0.20.0
*/ */
const uint_fast64_t max_toot_chars() const; uint_fast64_t max_toot_chars() const;
}; };
} }

View File

@ -29,7 +29,7 @@ List::List()
: Entity() : Entity()
{} {}
const bool List::valid() const bool List::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -40,7 +40,7 @@ const bool List::valid() const
return Entity::check_valid(attributes); return Entity::check_valid(attributes);
} }
const uint_fast64_t List::id() const uint_fast64_t List::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }

View File

@ -59,14 +59,14 @@ namespace Mastodon
*/ */
List(); List();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns list-ID * @brief Returns list-ID
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
/*! /*!
* @brief Returns title * @brief Returns title

View File

@ -27,7 +27,7 @@ Mention::Mention()
: Entity() : Entity()
{} {}
const bool Mention::valid() const bool Mention::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -45,7 +45,7 @@ const string Mention::acct() const
return get_string("acct"); return get_string("acct");
} }
const uint_fast64_t Mention::id() const uint_fast64_t Mention::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }

View File

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

View File

@ -28,7 +28,7 @@ Notification::Notification()
: Entity() : Entity()
{} {}
const bool Notification::valid() const bool Notification::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -58,7 +58,7 @@ const system_clock::time_point Notification::created_at() const
return get_time_point("created_at"); return get_time_point("created_at");
} }
const uint_fast64_t Notification::id() const uint_fast64_t Notification::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }
@ -75,7 +75,7 @@ const Easy::Status Notification::status() const
return Easy::Status(); return Easy::Status();
} }
const Easy::notification_type Notification::type() const Easy::notification_type Notification::type() const
{ {
const string strtype = get_string("type"); const string strtype = get_string("type");
if (strtype.compare("mention") == 0) if (strtype.compare("mention") == 0)

View File

@ -64,7 +64,7 @@ namespace Mastodon
*/ */
Notification(); Notification();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the Account sending the notification to the user * @brief Returns the Account sending the notification to the user
@ -85,7 +85,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
/*! /*!
* @brief Returns the Status associated with the notification, if * @brief Returns the Status associated with the notification, if
@ -100,7 +100,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const Easy::notification_type type() const; Easy::notification_type type() const;
}; };
} }

View File

@ -23,7 +23,7 @@ PushSubscription::PushSubscription(const string &json)
: Entity(json) : Entity(json)
{} {}
const uint_fast64_t PushSubscription::id() const uint_fast64_t PushSubscription::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }
@ -32,7 +32,7 @@ PushSubscription::PushSubscription()
: Entity() : Entity()
{} {}
const bool PushSubscription::valid() const bool PushSubscription::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -88,7 +88,7 @@ const Easy::alertmap PushSubscription::alerts() const
return alerts; return alerts;
} }
const bool PushSubscription::s_to_b(const string &str) const bool PushSubscription::s_to_b(const string &str) const
{ {
if (str.compare("true") == 0) if (str.compare("true") == 0)
{ {

View File

@ -59,14 +59,14 @@ namespace Mastodon
*/ */
PushSubscription(); PushSubscription();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns push subscription ID * @brief Returns push subscription ID
* *
* @since 0.14.0 * @since 0.14.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
/*! /*!
* @brief Returns the endpoint URL * @brief Returns the endpoint URL
@ -97,7 +97,7 @@ namespace Mastodon
* *
* @return `true` if str is equal to "true", `false` otherwise * @return `true` if str is equal to "true", `false` otherwise
*/ */
const bool s_to_b(const string &str) const; bool s_to_b(const string &str) const;
}; };
} }

View File

@ -27,7 +27,7 @@ Relationship::Relationship()
: Entity() : Entity()
{} {}
const bool Relationship::valid() const bool Relationship::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -44,52 +44,52 @@ const bool Relationship::valid() const
return Entity::check_valid(attributes); return Entity::check_valid(attributes);
} }
const bool Relationship::blocking() const bool Relationship::blocking() const
{ {
return get_bool("blocking"); return get_bool("blocking");
} }
const bool Relationship::domain_blocking() const bool Relationship::domain_blocking() const
{ {
return get_bool("domain_blocking"); return get_bool("domain_blocking");
} }
const bool Relationship::endorsed() const bool Relationship::endorsed() const
{ {
return get_bool("endorsed"); return get_bool("endorsed");
} }
const bool Relationship::followed_by() const bool Relationship::followed_by() const
{ {
return get_bool("followed_by"); return get_bool("followed_by");
} }
const bool Relationship::following() const bool Relationship::following() const
{ {
return get_bool("following"); return get_bool("following");
} }
const uint_fast64_t Relationship::id() const uint_fast64_t Relationship::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }
const bool Relationship::muting() const bool Relationship::muting() const
{ {
return get_bool("muting"); return get_bool("muting");
} }
const bool Relationship::muting_notifications() const bool Relationship::muting_notifications() const
{ {
return get_bool("muting_notifications"); return get_bool("muting_notifications");
} }
const bool Relationship::requested() const bool Relationship::requested() const
{ {
return get_bool("requested"); return get_bool("requested");
} }
const bool Relationship::showing_notifications() const bool Relationship::showing_notifications() const
{ {
return get_bool("showing_notifications"); return get_bool("showing_notifications");
} }

View File

@ -58,77 +58,77 @@ namespace Mastodon
*/ */
Relationship(); Relationship();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns true if the user is blocking the account * @brief Returns true if the user is blocking the account
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool blocking() const; bool blocking() const;
/*! /*!
* @brief Returns true if the user is blocking the account's domain * @brief Returns true if the user is blocking the account's domain
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool domain_blocking() const; bool domain_blocking() const;
/*! /*!
* @brief Returns true if the account is endorsed by the user * @brief Returns true if the account is endorsed by the user
* *
* @since 0.19.0 * @since 0.19.0
*/ */
const bool endorsed() const; bool endorsed() const;
/*! /*!
* @brief Returns true if the user is being followed by the account * @brief Returns true if the user is being followed by the account
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool followed_by() const; bool followed_by() const;
/*! /*!
* @brief Returns true if the user is being following the account * @brief Returns true if the user is being following the account
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool following() const; bool following() const;
/*! /*!
* @brief Returns the target account ID * @brief Returns the target account ID
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
/*! /*!
* @brief Returns true if the user is muting the account * @brief Returns true if the user is muting the account
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool muting() const; bool muting() const;
/*! /*!
* @brief Returns true if the user is also muting notifications * @brief Returns true if the user is also muting notifications
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool muting_notifications() const; bool muting_notifications() const;
/*! /*!
* @brief Returns true if the user has requested to follow the account * @brief Returns true if the user has requested to follow the account
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool requested() const; bool requested() const;
/*! /*!
* @brief Returns true if the user is showing notifications * @brief Returns true if the user is showing notifications
* *
* @since 0.19.0 * @since 0.19.0
*/ */
const bool showing_notifications() const; bool showing_notifications() const;
}; };
} }

View File

@ -27,7 +27,7 @@ Report::Report()
: Entity() : Entity()
{} {}
const bool Report::valid() const bool Report::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -38,12 +38,12 @@ const bool Report::valid() const
return Entity::check_valid(attributes); return Entity::check_valid(attributes);
} }
const bool Report::action_taken() const bool Report::action_taken() const
{ {
return get_bool("action_taken"); return get_bool("action_taken");
} }
const uint_fast64_t Report::id() const uint_fast64_t Report::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }

View File

@ -58,7 +58,7 @@ namespace Mastodon
*/ */
Report(); Report();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns true if an action was taken in response to the * @brief Returns true if an action was taken in response to the
@ -66,14 +66,14 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool action_taken() const; bool action_taken() const;
/*! /*!
* @brief Returns the ID of the report * @brief Returns the ID of the report
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
}; };
} }

View File

@ -28,7 +28,7 @@ Results::Results()
: Entity() : Entity()
{} {}
const bool Results::valid() const bool Results::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{

View File

@ -63,7 +63,7 @@ namespace Mastodon
*/ */
Results(); Results();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns an array of matched Accounts * @brief Returns an array of matched Accounts

View File

@ -29,7 +29,7 @@ Status::Status()
: Entity() : Entity()
{} {}
const bool Status::valid() const bool Status::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -117,22 +117,22 @@ const std::vector<Easy::Emoji> Status::emojis() const
return {}; return {};
} }
const bool Status::favourited() const bool Status::favourited() const
{ {
return get_bool("favourited"); return get_bool("favourited");
} }
const uint_fast64_t Status::favourites_count() const uint_fast64_t Status::favourites_count() const
{ {
return get_uint64("favourites_count"); return get_uint64("favourites_count");
} }
const uint_fast64_t Status::id() const uint_fast64_t Status::id() const
{ {
return stouint64(get_string("id")); return stouint64(get_string("id"));
} }
const uint_fast64_t Status::in_reply_to_id() const uint_fast64_t Status::in_reply_to_id() const
{ {
return stouint64(get_string("in_reply_to_id")); return stouint64(get_string("in_reply_to_id"));
} }
@ -143,7 +143,7 @@ Status Status::in_reply_to_id(const uint_fast64_t &in_reply_to_id)
return *this; return *this;
} }
const uint_fast64_t Status::in_reply_to_account_id() const uint_fast64_t Status::in_reply_to_account_id() const
{ {
return stouint64(get_string("in_reply_to_account_id")); return stouint64(get_string("in_reply_to_account_id"));
} }
@ -205,12 +205,12 @@ const std::vector<Easy::Mention> Status::mentions() const
return {}; return {};
} }
const bool Status::muted() const bool Status::muted() const
{ {
return get_bool("muted"); return get_bool("muted");
} }
const bool Status::pinned() const bool Status::pinned() const
{ {
return get_bool("pinned"); return get_bool("pinned");
} }
@ -226,22 +226,22 @@ const Status Status::reblog() const
return Easy::Status(); return Easy::Status();
} }
const bool Status::reblogged() const bool Status::reblogged() const
{ {
return get_bool("reblogged"); return get_bool("reblogged");
} }
const uint_fast64_t Status::reblogs_count() const uint_fast64_t Status::reblogs_count() const
{ {
return get_uint64("reblogs_count"); return get_uint64("reblogs_count");
} }
const uint_fast64_t Status::replies_count() const uint_fast64_t Status::replies_count() const
{ {
return get_uint64("replies_count"); return get_uint64("replies_count");
} }
const bool Status::sensitive() const bool Status::sensitive() const
{ {
return get_bool("sensitive"); return get_bool("sensitive");
} }
@ -289,7 +289,7 @@ const string Status::url() const
return get_string("url"); return get_string("url");
} }
const Easy::visibility_type Status::visibility() const Easy::visibility_type Status::visibility() const
{ {
const string strvisibility = get_string("visibility"); const string strvisibility = get_string("visibility");
if (strvisibility.compare("public") == 0) if (strvisibility.compare("public") == 0)

View File

@ -75,7 +75,7 @@ namespace Mastodon
*/ */
Status(); Status();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns an array of matched accounts. * @brief Returns an array of matched accounts.
@ -131,28 +131,28 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool favourited() const; bool favourited() const;
/*! /*!
* @brief Returns the number of favourites * @brief Returns the number of favourites
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t favourites_count() const; uint_fast64_t favourites_count() const;
/*! /*!
* @brief Returns the ID of the status * @brief Returns the ID of the status
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t id() const; uint_fast64_t id() const;
/*! /*!
* @brief Returns the ID of the status it replies to * @brief Returns the ID of the status it replies to
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t in_reply_to_id() const; uint_fast64_t in_reply_to_id() const;
/*! /*!
* @brief Sets the ID of the status it replies to * @brief Sets the ID of the status it replies to
@ -166,7 +166,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t in_reply_to_account_id() const; uint_fast64_t in_reply_to_account_id() const;
/*! /*!
* @brief Returns the language of the status * @brief Returns the language of the status
@ -209,14 +209,14 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool muted() const; bool muted() const;
/*! /*!
* @brief Returns true if the status is pinned * @brief Returns true if the status is pinned
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool pinned() const; bool pinned() const;
/*! /*!
* @brief Returns the reblogged Status * @brief Returns the reblogged Status
@ -230,28 +230,28 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool reblogged() const; bool reblogged() const;
/*! /*!
* @brief Returns the number of reblogs for the status * @brief Returns the number of reblogs for the status
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast64_t reblogs_count() const; uint_fast64_t reblogs_count() const;
/*! /*!
* @brief Returns the number of replies for the status * @brief Returns the number of replies for the status
* *
* @since 0.19.0 * @since 0.19.0
*/ */
const uint_fast64_t replies_count() const; uint_fast64_t replies_count() const;
/*! /*!
* @brief Returns true if the attachments should be hidden by default * @brief Returns true if the attachments should be hidden by default
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const bool sensitive() const; bool sensitive() const;
/*! /*!
* @brief Sets sensitive flag for attachments * @brief Sets sensitive flag for attachments
@ -300,7 +300,7 @@ namespace Mastodon
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const visibility_type visibility() const; visibility_type visibility() const;
/*! /*!
* @brief Sets the visibility of the status * @brief Sets the visibility of the status

View File

@ -30,7 +30,7 @@ Tag::Tag()
: Entity() : Entity()
{} {}
const bool Tag::valid() const bool Tag::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -77,7 +77,7 @@ Tag::History::History()
: Entity() : Entity()
{} {}
const bool Tag::History::valid() const bool Tag::History::valid() const
{ {
const std::vector<string> attributes = const std::vector<string> attributes =
{{ {{
@ -89,7 +89,7 @@ const bool Tag::History::valid() const
return Entity::check_valid(attributes); return Entity::check_valid(attributes);
} }
const uint_fast64_t Tag::History::accounts() uint_fast64_t Tag::History::accounts()
{ {
return stouint64(get_string("accounts")); return stouint64(get_string("accounts"));
} }
@ -108,7 +108,7 @@ const system_clock::time_point Tag::History::day()
return system_clock::time_point(); return system_clock::time_point();
} }
const uint_fast64_t Tag::History::uses() uint_fast64_t Tag::History::uses()
{ {
return stouint64(get_string("uses")); return stouint64(get_string("uses"));
} }

View File

@ -68,14 +68,14 @@ namespace Mastodon
*/ */
History(); History();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the number of accounts using that hashtag. * @brief Returns the number of accounts using that hashtag.
* *
* @since 0.16.0 * @since 0.16.0
*/ */
const uint_fast64_t accounts(); uint_fast64_t accounts();
/*! /*!
* @brief Returns the day. * @brief Returns the day.
@ -89,7 +89,7 @@ namespace Mastodon
* *
* @since 0.16.0 * @since 0.16.0
*/ */
const uint_fast64_t uses(); uint_fast64_t uses();
}; };
/*! /*!
@ -108,7 +108,7 @@ namespace Mastodon
*/ */
Tag(); Tag();
virtual const bool valid() const; virtual bool valid() const;
/*! /*!
* @brief Returns the name of the tag * @brief Returns the name of the tag

View File

@ -33,7 +33,7 @@ Easy::Entity::Entity(const string &json)
from_string(json); from_string(json);
} }
const void Easy::Entity::from_string(const string &json) void Easy::Entity::from_string(const string &json)
{ {
std::stringstream ss(json); std::stringstream ss(json);
ss >> _tree; ss >> _tree;
@ -66,8 +66,7 @@ Easy::Entity::Entity()
: _was_set(false) : _was_set(false)
{} {}
const bool bool Easy::Entity::check_valid(const std::vector<string> &attributes) const
Easy::Entity::check_valid(const std::vector<string> &attributes) const
{ {
for (const string &attribute: attributes) for (const string &attribute: attributes)
{ {
@ -86,7 +85,7 @@ const string Easy::Entity::error() const
return get_string("error"); return get_string("error");
} }
const bool Easy::Entity::was_set() const bool Easy::Entity::was_set() const
{ {
return _was_set; return _was_set;
} }
@ -146,7 +145,7 @@ const string Easy::Entity::get_string(const string &key) const
return ""; return "";
} }
const uint_fast64_t Easy::Entity::get_uint64(const string &key) const uint_fast64_t Easy::Entity::get_uint64(const string &key) const
{ {
const Json::Value node = get(key); const Json::Value node = get(key);
@ -160,7 +159,7 @@ const uint_fast64_t Easy::Entity::get_uint64(const string &key) const
return 0; return 0;
} }
const double Easy::Entity::get_double(const string &key) const double Easy::Entity::get_double(const string &key) const
{ {
const Json::Value node = get(key); const Json::Value node = get(key);
@ -174,7 +173,7 @@ const double Easy::Entity::get_double(const string &key) const
return 0.0; return 0.0;
} }
const bool Easy::Entity::get_bool(const string &key) const bool Easy::Entity::get_bool(const string &key) const
{ {
const Json::Value node = get(key); const Json::Value node = get(key);
@ -196,7 +195,7 @@ const system_clock::time_point
if (node.isString()) if (node.isString())
{ {
std::stringstream sstime(node.asString()); std::stringstream sstime(node.asString());
struct std::tm tm = {0}; struct std::tm tm;
sstime >> std::get_time(&tm, "%Y-%m-%dT%T"); sstime >> std::get_time(&tm, "%Y-%m-%dT%T");
std::time_t time = timegm(&tm); std::time_t time = timegm(&tm);
_was_set = true; _was_set = true;
@ -227,7 +226,7 @@ const std::vector<string> Easy::Entity::get_vector(const string &key) const
return {}; return {};
} }
const void Easy::Entity::set(const string &key, const Json::Value &value) void Easy::Entity::set(const string &key, const Json::Value &value)
{ {
if (key.find('.') == std::string::npos) if (key.find('.') == std::string::npos)
{ {
@ -265,7 +264,7 @@ const void Easy::Entity::set(const string &key, const Json::Value &value)
ttdebug << "Could not set data: " << key << '\n'; ttdebug << "Could not set data: " << key << '\n';
} }
const std::uint_fast64_t Easy::Entity::stouint64(const string &str) const std::uint_fast64_t Easy::Entity::stouint64(const string &str) const
{ {
if (str == "") if (str == "")
{ {

View File

@ -44,17 +44,17 @@ API::http::~http()
curlpp::terminate(); curlpp::terminate();
} }
const uint_fast16_t API::http::request(const method &meth, uint_fast16_t API::http::request(const method &meth,
const string &path, const string &path,
string &answer) string &answer)
{ {
return request(meth, path, curlpp::Forms(), answer); return request(meth, path, curlpp::Forms(), answer);
} }
const uint_fast16_t API::http::request(const method &meth, uint_fast16_t API::http::request(const method &meth,
const string &path, const string &path,
const curlpp::Forms &formdata, const curlpp::Forms &formdata,
string &answer) string &answer)
{ {
using namespace std::placeholders; // _1, _2, _3 using namespace std::placeholders; // _1, _2, _3
@ -119,8 +119,10 @@ const uint_fast16_t API::http::request(const method &meth,
break; break;
case http::method::PUT: case http::method::PUT:
request.setOpt<curlopts::CustomRequest>("PUT"); request.setOpt<curlopts::CustomRequest>("PUT");
break;
case http::method::DELETE: case http::method::DELETE:
request.setOpt<curlopts::CustomRequest>("DELETE"); request.setOpt<curlopts::CustomRequest>("DELETE");
break;
default: default:
break; break;
} }
@ -194,25 +196,25 @@ const uint_fast16_t API::http::request(const method &meth,
} }
} }
const void API::http::get_headers(string &headers) const void API::http::get_headers(string &headers) const
{ {
headers = _headers; headers = _headers;
} }
const size_t API::http::callback_write(char* data, size_t size, size_t nmemb, size_t API::http::callback_write(char* data, size_t size, size_t nmemb,
string *str) string *str)
{ {
std::lock_guard<std::mutex> lock(_mutex); std::lock_guard<std::mutex> lock(_mutex);
str->append(data, size * nmemb); str->append(data, size * nmemb);
// ttdebug << "Received " << size * nmemb << " Bytes\n"; // ttdebug << "Received " << size * nmemb << " Bytes\n";
return size * nmemb; return size * nmemb;
}; }
const size_t API::http::callback(char* data, size_t size, size_t nmemb, size_t API::http::callback(char* data, size_t size, size_t nmemb,
string *str) string *str)
{ {
return callback_write(data, size, nmemb, str); return callback_write(data, size, nmemb, str);
}; }
double API::http::callback_progress(double /* dltotal */, double /* dlnow */, double API::http::callback_progress(double /* dltotal */, double /* dlnow */,
double /* ultotal */, double /* ulnow */) double /* ultotal */, double /* ulnow */)
@ -223,14 +225,14 @@ double API::http::callback_progress(double /* dltotal */, double /* dlnow */,
return 1; return 1;
} }
return 0; return 0;
}; }
const void API::http::cancel_stream() void API::http::cancel_stream()
{ {
_cancel_stream = true; _cancel_stream = true;
} }
const void API::http::abort_stream() void API::http::abort_stream()
{ {
cancel_stream(); cancel_stream();
} }

View File

@ -39,7 +39,7 @@ API::API(const string &instance, const string &access_token)
// //
} }
const void API::set_useragent(const std::string &useragent) void API::set_useragent(const std::string &useragent)
{ {
_useragent = useragent; _useragent = useragent;
} }
@ -148,25 +148,25 @@ const std::string API::urldecode(const std::string &str)
return curlpp::unescape(str); return curlpp::unescape(str);
} }
const uint_fast16_t API::register_app1(const string &instance, uint_fast16_t API::register_app1(const string &instance,
const string &client_name, const string &client_name,
const string &redirect_uri, const string &redirect_uri,
const string &scopes, const string &scopes,
const string &website, const string &website,
string &client_id, string &client_id,
string &client_secret, string &client_secret,
string &url) string &url)
{ {
return register_app1(client_name, redirect_uri, scopes, website, return register_app1(client_name, redirect_uri, scopes, website,
client_id, client_secret, url); client_id, client_secret, url);
} }
const uint_fast16_t API::register_app1(const string &client_name, uint_fast16_t API::register_app1(const string &client_name,
const string &redirect_uri, const string &redirect_uri,
const string &scopes, const string &scopes,
const string &website, const string &website,
string &client_id, string &client_id,
string &client_secret, string &client_secret,
string &url) string &url)
{ {
API::parametermap parameters = API::parametermap parameters =
{ {
@ -214,21 +214,21 @@ const uint_fast16_t API::register_app1(const string &client_name,
} }
const uint_fast16_t API::register_app2(const string &instance, uint_fast16_t API::register_app2(const string &instance,
const string &client_id, const string &client_id,
const string &client_secret, const string &client_secret,
const string &redirect_uri, const string &redirect_uri,
const string &code, const string &code,
string &access_token) string &access_token)
{ {
return register_app2(client_id, client_secret, redirect_uri, code, access_token); return register_app2(client_id, client_secret, redirect_uri, code, access_token);
} }
const uint_fast16_t API::register_app2(const string &client_id, uint_fast16_t API::register_app2(const string &client_id,
const string &client_secret, const string &client_secret,
const string &redirect_uri, const string &redirect_uri,
const string &code, const string &code,
string &access_token) string &access_token)
{ {
API::parametermap parameters = API::parametermap parameters =
{ {
@ -280,7 +280,7 @@ bool API::exceptions(const bool &value)
return _exceptions; return _exceptions;
} }
const bool API::exceptions() const bool API::exceptions() const
{ {
return _exceptions; return _exceptions;
} }
@ -586,13 +586,13 @@ const string API::unescape_html(const string &html)
return output; return output;
} }
const void API::set_proxy(const string &proxy, const string &userpw) void API::set_proxy(const string &proxy, const string &userpw)
{ {
_proxy = proxy; _proxy = proxy;
_proxy_userpw = userpw; _proxy_userpw = userpw;
} }
const void API::get_proxy(string &proxy, string &userpw) const void API::get_proxy(string &proxy, string &userpw) const
{ {
if (!_proxy.empty()) if (!_proxy.empty())
{ {

View File

@ -101,7 +101,7 @@ public:
explicit http(const API &api, const string &instance, explicit http(const API &api, const string &instance,
const string &access_token); const string &access_token);
~http(); ~http();
const uint_fast16_t request(const method &meth, uint_fast16_t request(const method &meth,
const string &path, const string &path,
string &answer); string &answer);
@ -118,7 +118,7 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t request(const method &meth, uint_fast16_t request(const method &meth,
const string &path, const string &path,
const curlpp::Forms &formdata, const curlpp::Forms &formdata,
string &answer); string &answer);
@ -126,7 +126,7 @@ public:
/*! /*!
* @brief Get all headers in a string * @brief Get all headers in a string
*/ */
const void get_headers(string &headers) const; void get_headers(string &headers) const;
/*! /*!
* @brief Cancels the stream. Use only with streams. * @brief Cancels the stream. Use only with streams.
@ -138,10 +138,10 @@ public:
* *
* @since 0.12.2 * @since 0.12.2
*/ */
const void cancel_stream(); void cancel_stream();
[[deprecated("Will vanish in 1.0.0. Use cancel_stream() instead.")]] [[deprecated("Will vanish in 1.0.0. Use cancel_stream() instead.")]]
const void abort_stream(); void abort_stream();
/*! /*!
* @brief Gets the mutex guarding the string that is written to. * @brief Gets the mutex guarding the string that is written to.
@ -163,10 +163,10 @@ public:
bool _cancel_stream; bool _cancel_stream;
std::mutex _mutex; std::mutex _mutex;
const size_t callback_write(char* data, size_t size, size_t nmemb, size_t callback_write(char* data, size_t size, size_t nmemb,
string *oss); string *oss);
[[deprecated("Will vanish in 1.0.0. Use callback_write() instead.")]] [[deprecated("Will vanish in 1.0.0. Use callback_write() instead.")]]
const size_t callback(char* data, size_t size, size_t nmemb, size_t callback(char* data, size_t size, size_t nmemb,
string *oss); string *oss);
double callback_progress(double /* dltotal */, double /* dlnow */, double callback_progress(double /* dltotal */, double /* dlnow */,
double /* ultotal */, double /* ulnow */); double /* ultotal */, double /* ulnow */);
@ -304,7 +304,7 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const void set_useragent(const string &useragent); void set_useragent(const string &useragent);
/*! /*!
* @brief Gets the useragent. * @brief Gets the useragent.
@ -375,23 +375,23 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t register_app1(const string &client_name, uint_fast16_t register_app1(const string &client_name,
const string &redirect_uri, const string &redirect_uri,
const string &scopes, const string &scopes,
const string &website, const string &website,
string &client_id, string &client_id,
string &client_secret, string &client_secret,
string &url); string &url);
[[deprecated("Will vanish in 1.0.0")]] [[deprecated("Will vanish in 1.0.0")]]
const uint_fast16_t register_app1(const string &instance, uint_fast16_t register_app1(const string &instance,
const string &client_name, const string &client_name,
const string &redirect_uri, const string &redirect_uri,
const string &scopes, const string &scopes,
const string &website, const string &website,
string &client_id, string &client_id,
string &client_secret, string &client_secret,
string &url); string &url);
/*! /*!
* @brief Register application, step 2/2 * @brief Register application, step 2/2
@ -408,19 +408,19 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t register_app2(const string &client_id, uint_fast16_t register_app2(const string &client_id,
const string &client_secret, const string &client_secret,
const string &redirect_uri, const string &redirect_uri,
const string &code, const string &code,
string &access_token); string &access_token);
[[deprecated("Will vanish in 1.0.0")]] [[deprecated("Will vanish in 1.0.0")]]
const uint_fast16_t register_app2(const string &instance, uint_fast16_t register_app2(const string &instance,
const string &client_id, const string &client_id,
const string &client_secret, const string &client_secret,
const string &redirect_uri, const string &redirect_uri,
const string &code, const string &code,
string &access_token); string &access_token);
/*! /*!
* @brief Gets the header from the last answer. * @brief Gets the header from the last answer.
@ -450,7 +450,7 @@ public:
/*! /*!
* @brief Returns true if exceptions are turned on, false otherwise * @brief Returns true if exceptions are turned on, false otherwise
*/ */
const bool exceptions() const; bool exceptions() const;
/*! /*!
* @brief Replaces HTML entities with UTF-8 characters * @brief Replaces HTML entities with UTF-8 characters
@ -472,7 +472,7 @@ public:
* *
* @since 0.15.0 * @since 0.15.0
*/ */
const void set_proxy(const string &proxy, const string &userpw = ""); void set_proxy(const string &proxy, const string &userpw = "");
/*! /*!
* @brief For internal use * @brief For internal use
@ -482,7 +482,7 @@ public:
* *
* @since 0.15.1 * @since 0.15.1
*/ */
const void get_proxy(string &proxy, string &userpw) const; void get_proxy(string &proxy, string &userpw) const;
/*! /*!
* @brief Make a GET request which doesn't require parameters. * @brief Make a GET request which doesn't require parameters.
@ -495,7 +495,7 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t get(const Mastodon::API::v1 &call, string &answer); uint_fast16_t get(const Mastodon::API::v1 &call, string &answer);
/*! /*!
* @brief Make a GET request which requires parameters. * @brief Make a GET request which requires parameters.
@ -508,18 +508,18 @@ public:
* @return @ref error "Error code". If the URL has permanently changed, 13 * @return @ref error "Error code". If the URL has permanently changed, 13
* is returned and answer is set to the new URL. * is returned and answer is set to the new URL.
*/ */
const uint_fast16_t get(const Mastodon::API::v1 &call, uint_fast16_t get(const Mastodon::API::v1 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a GET request which requires parameters. * @brief Make a GET request which requires parameters.
* *
* @since 0.16.0 * @since 0.16.0
*/ */
const uint_fast16_t get(const Mastodon::API::v2 &call, uint_fast16_t get(const Mastodon::API::v2 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a custom GET request. * @brief Make a custom GET request.
@ -533,20 +533,20 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t get(const string &call, string &answer); uint_fast16_t get(const string &call, string &answer);
[[deprecated("Will vanish in 1.0.0, use get() without string argument " [[deprecated("Will vanish in 1.0.0, use get() without string argument "
"instead.")]] "instead.")]]
const uint_fast16_t get(const Mastodon::API::v1 &call, uint_fast16_t get(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
string &answer); string &answer);
[[deprecated("Will vanish in 1.0.0, use get() without string argument " [[deprecated("Will vanish in 1.0.0, use get() without string argument "
"instead.")]] "instead.")]]
const uint_fast16_t get(const Mastodon::API::v1 &call, uint_fast16_t get(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a streaming GET request. * @brief Make a streaming GET request.
@ -562,10 +562,10 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t get_stream(const Mastodon::API::v1 &call, uint_fast16_t get_stream(const Mastodon::API::v1 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer, string &answer,
std::unique_ptr<Mastodon::API::http> &ptr); std::unique_ptr<Mastodon::API::http> &ptr);
/*! /*!
* @brief Make a streaming GET request. * @brief Make a streaming GET request.
@ -580,9 +580,9 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t get_stream(const Mastodon::API::v1 &call, uint_fast16_t get_stream(const Mastodon::API::v1 &call,
string &answer, string &answer,
std::unique_ptr<Mastodon::API::http> &ptr); std::unique_ptr<Mastodon::API::http> &ptr);
/*! /*!
* @brief Make a streaming GET request. * @brief Make a streaming GET request.
@ -598,16 +598,16 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t get_stream(const string &call, uint_fast16_t get_stream(const string &call,
string &answer, string &answer,
std::unique_ptr<Mastodon::API::http> &ptr); std::unique_ptr<Mastodon::API::http> &ptr);
[[deprecated("Will vanish in 1.0.0, use get_stream() without string " [[deprecated("Will vanish in 1.0.0, use get_stream() without string "
"argument instead.")]] "argument instead.")]]
const uint_fast16_t get_stream(const Mastodon::API::v1 &call, uint_fast16_t get_stream(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
string &answer, string &answer,
std::unique_ptr<Mastodon::API::http> &ptr); std::unique_ptr<Mastodon::API::http> &ptr);
/*! /*!
* @brief Make a PATCH request. * @brief Make a PATCH request.
@ -624,9 +624,9 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t patch(const Mastodon::API::v1 &call, uint_fast16_t patch(const Mastodon::API::v1 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a POST request which doesn't require parameters. * @brief Make a POST request which doesn't require parameters.
@ -640,7 +640,7 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t post(const Mastodon::API::v1 &call, string &answer); uint_fast16_t post(const Mastodon::API::v1 &call, string &answer);
/*! /*!
* @brief Make a POST request which requires parameters. * @brief Make a POST request which requires parameters.
@ -657,9 +657,9 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t post(const Mastodon::API::v1 &call, uint_fast16_t post(const Mastodon::API::v1 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a custom POST request. * @brief Make a custom POST request.
@ -676,22 +676,22 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t post(const string &call, uint_fast16_t post(const string &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
[[deprecated("Will vanish in 1.0.0, use post() without string argument " [[deprecated("Will vanish in 1.0.0, use post() without string argument "
"instead.")]] "instead.")]]
const uint_fast16_t post(const Mastodon::API::v1 &call, uint_fast16_t post(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
string &answer); string &answer);
[[deprecated("Will vanish in 1.0.0, use post() without string argument " [[deprecated("Will vanish in 1.0.0, use post() without string argument "
"instead.")]] "instead.")]]
const uint_fast16_t post(const Mastodon::API::v1 &call, uint_fast16_t post(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a PUT request which requires a parameters. * @brief Make a PUT request which requires a parameters.
@ -707,9 +707,9 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t put(const Mastodon::API::v1 &call, uint_fast16_t put(const Mastodon::API::v1 &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a custom PUT request. * @brief Make a custom PUT request.
@ -725,16 +725,16 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t put(const string &call, uint_fast16_t put(const string &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
[[deprecated("Will vanish in 1.0.0, use put() without string argument " [[deprecated("Will vanish in 1.0.0, use put() without string argument "
"instead.")]] "instead.")]]
const uint_fast16_t put(const Mastodon::API::v1 &call, uint_fast16_t put(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
/*! /*!
* @brief Make a DELETE request which requires parameters. * @brief Make a DELETE request which requires parameters.
@ -746,8 +746,8 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t del(const Mastodon::API::v1 &call, uint_fast16_t del(const Mastodon::API::v1 &call,
const parametermap &parameters); const parametermap &parameters);
/*! /*!
* @brief Make a custom DELETE request. * @brief Make a custom DELETE request.
@ -762,20 +762,20 @@ public:
* *
* @since before 0.11.0 * @since before 0.11.0
*/ */
const uint_fast16_t del(const string &call, uint_fast16_t del(const string &call,
const parametermap &parameters, const parametermap &parameters,
string &answer); string &answer);
[[deprecated("Will vanish in 1.0.0, use del() without string argument " [[deprecated("Will vanish in 1.0.0, use del() without string argument "
"instead.")]] "instead.")]]
const uint_fast16_t del(const Mastodon::API::v1 &call, uint_fast16_t del(const Mastodon::API::v1 &call,
const string &argument); const string &argument);
[[deprecated("Will vanish in 1.0.0, use del() without string argument " [[deprecated("Will vanish in 1.0.0, use del() without string argument "
"instead.")]] "instead.")]]
const uint_fast16_t del(const Mastodon::API::v1 &call, uint_fast16_t del(const Mastodon::API::v1 &call,
const string &argument, const string &argument,
const parametermap &parameters); const parametermap &parameters);
private: private:
const string _instance; const string _instance;