Changed uint_fast16_t to uint16_t and uint_fast64_t to uint64_t.
This commit is contained in:
parent
24687cba07
commit
318221a2e6
|
@ -20,7 +20,7 @@
|
|||
|
||||
using namespace Mastodon;
|
||||
|
||||
uint_fast16_t API::del(const Mastodon::API::v1 &call,
|
||||
uint16_t API::del(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters)
|
||||
{
|
||||
string strcall = "";
|
||||
|
@ -60,7 +60,7 @@ uint_fast16_t API::del(const Mastodon::API::v1 &call,
|
|||
return del(strcall, parameters, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::del(const std::string &call,
|
||||
uint16_t API::del(const std::string &call,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
using namespace Mastodon;
|
||||
using std::cerr;
|
||||
|
||||
uint_fast16_t API::get(const Mastodon::API::v1 &call,
|
||||
uint16_t API::get(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
string strcall = "";
|
||||
|
@ -168,7 +168,7 @@ uint_fast16_t API::get(const Mastodon::API::v1 &call,
|
|||
return get(strcall, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::get(const Mastodon::API::v2 &call,
|
||||
uint16_t API::get(const Mastodon::API::v2 &call,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
string strcall = "";
|
||||
|
@ -204,13 +204,13 @@ uint_fast16_t API::get(const Mastodon::API::v2 &call,
|
|||
return get(strcall, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::get(const Mastodon::API::v1 &call, string &answer)
|
||||
uint16_t API::get(const Mastodon::API::v1 &call, string &answer)
|
||||
{
|
||||
const parametermap p;
|
||||
return get(call, p, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::get(const std::string &call, string &answer)
|
||||
uint16_t API::get(const std::string &call, string &answer)
|
||||
{
|
||||
return _http.request(http::method::GET, call, answer);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
using namespace Mastodon;
|
||||
using std::cerr;
|
||||
|
||||
uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
|
||||
uint16_t API::get_stream(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr)
|
||||
|
@ -59,7 +59,7 @@ uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
|
|||
return get_stream(strcall, answer, ptr);
|
||||
}
|
||||
|
||||
uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
|
||||
uint16_t API::get_stream(const Mastodon::API::v1 &call,
|
||||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ uint_fast16_t API::get_stream(const Mastodon::API::v1 &call,
|
|||
return get_stream(call, p, answer, ptr);
|
||||
}
|
||||
|
||||
uint_fast16_t API::get_stream(const std::string &call, string &answer,
|
||||
uint16_t API::get_stream(const std::string &call, string &answer,
|
||||
std::unique_ptr<http> &ptr)
|
||||
{
|
||||
ptr = std::make_unique<http>(*this, _instance, _access_token);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
using namespace Mastodon;
|
||||
using std::cerr;
|
||||
|
||||
uint_fast16_t API::patch(const Mastodon::API::v1 &call,
|
||||
uint16_t API::patch(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
using namespace Mastodon;
|
||||
|
||||
uint_fast16_t API::post(const Mastodon::API::v1 &call,
|
||||
uint16_t API::post(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
string strcall = "";
|
||||
|
@ -137,13 +137,13 @@ uint_fast16_t API::post(const Mastodon::API::v1 &call,
|
|||
return post(strcall, parameters, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::post(const Mastodon::API::v1 &call, string &answer)
|
||||
uint16_t API::post(const Mastodon::API::v1 &call, string &answer)
|
||||
{
|
||||
const parametermap p;
|
||||
return post(call, p, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::post(const string &call,
|
||||
uint16_t API::post(const string &call,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
using namespace Mastodon;
|
||||
|
||||
uint_fast16_t API::put(const Mastodon::API::v1 &call,
|
||||
uint16_t API::put(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
string strcall = "";
|
||||
|
@ -53,7 +53,7 @@ uint_fast16_t API::put(const Mastodon::API::v1 &call,
|
|||
return put(strcall, parameters, answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::put(const string &call,
|
||||
uint16_t API::put(const string &call,
|
||||
const parametermap ¶meters, string &answer)
|
||||
{
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ const string Easy::strtime_local(const system_clock::time_point &timepoint,
|
|||
const string Easy::strtime(const system_clock::time_point &timepoint,
|
||||
const string &format, const bool &utc)
|
||||
{
|
||||
constexpr std::uint_fast16_t bufsize = 1024;
|
||||
constexpr std::uint16_t bufsize = 1024;
|
||||
std::time_t time = system_clock::to_time_t(timepoint);
|
||||
std::tm *timeinfo;
|
||||
if (utc)
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint_fast16_t;
|
||||
using std::uint64_t;
|
||||
using std::uint16_t;
|
||||
using std::chrono::system_clock;
|
||||
|
||||
namespace Mastodon
|
||||
|
@ -286,14 +286,14 @@ public:
|
|||
*
|
||||
* @since 0.18.1
|
||||
*/
|
||||
const Status send_post(const Status &status, uint_fast16_t &error);
|
||||
const Status send_post(const Status &status, uint16_t &error);
|
||||
|
||||
/*!
|
||||
* @brief Alias for send_post()
|
||||
*
|
||||
* @since 0.17.0
|
||||
*/
|
||||
const Status send_toot(const Status &status, uint_fast16_t &error);
|
||||
const Status send_toot(const Status &status, uint16_t &error);
|
||||
|
||||
/*!
|
||||
* @brief Gets notifications.
|
||||
|
@ -308,7 +308,7 @@ public:
|
|||
* @since 0.21.0
|
||||
*/
|
||||
const vector<Notification> get_notifications(
|
||||
uint_fast16_t &error, const uint_fast16_t limit = 20,
|
||||
uint16_t &error, const uint16_t limit = 20,
|
||||
const string since_id = 0, const string max_id = 0);
|
||||
|
||||
/*!
|
||||
|
@ -414,11 +414,11 @@ public:
|
|||
const string get_string(const string &key) const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the value of key as std::uint_fast64_t
|
||||
* @brief Returns the value of key as std::uint64_t
|
||||
*
|
||||
* Returns 0 if the value does not exist or is null.
|
||||
*/
|
||||
uint_fast64_t get_uint64(const string &key) const;
|
||||
uint64_t get_uint64(const string &key) const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the value of key as double
|
||||
|
@ -457,7 +457,7 @@ public:
|
|||
*/
|
||||
void set(const string &key, const Json::Value &value);
|
||||
|
||||
std::uint_fast64_t stouint64(const string &str) const;
|
||||
std::uint64_t stouint64(const string &str) const;
|
||||
|
||||
/*!
|
||||
* @brief Checks if an Entity is valid
|
||||
|
|
|
@ -128,12 +128,12 @@ Account Account::fields(std::vector<Account::fields_pair> &fields)
|
|||
return *this;
|
||||
}
|
||||
|
||||
std::uint_fast64_t Account::followers_count() const
|
||||
std::uint64_t Account::followers_count() const
|
||||
{
|
||||
return get_uint64("followers_count");
|
||||
}
|
||||
|
||||
std::uint_fast64_t Account::following_count() const
|
||||
std::uint64_t Account::following_count() const
|
||||
{
|
||||
return get_uint64("following_count");
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ Account Account::source(const Account::Source &source)
|
|||
return *this;
|
||||
}
|
||||
|
||||
std::uint_fast64_t Account::statuses_count() const
|
||||
std::uint64_t Account::statuses_count() const
|
||||
{
|
||||
return get_uint64("statuses_count");
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
using std::chrono::system_clock;
|
||||
|
||||
namespace Mastodon
|
||||
|
@ -151,14 +151,14 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t followers_count() const;
|
||||
uint64_t followers_count() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns number of people this account follows
|
||||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t following_count() const;
|
||||
uint64_t following_count() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns URL of header image
|
||||
|
@ -338,7 +338,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t statuses_count() const;
|
||||
uint64_t statuses_count() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns URL of the profile
|
||||
|
|
|
@ -52,7 +52,7 @@ double Attachment::aspect_small() const
|
|||
return get_double("meta.small.aspect");
|
||||
}
|
||||
|
||||
uint_fast64_t Attachment::bitrate() const
|
||||
uint64_t Attachment::bitrate() const
|
||||
{
|
||||
return get_uint64("meta.original.bitrate");
|
||||
}
|
||||
|
@ -119,8 +119,8 @@ double Attachment::framerate() const
|
|||
std::size_t pos = strframes.find('/');
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
std::uint_fast16_t frames = std::stoul(strframes.substr(0, pos));
|
||||
std::uint_fast16_t divider = std::stoul(strframes.substr(pos + 1));
|
||||
std::uint16_t frames = std::stoul(strframes.substr(0, pos));
|
||||
std::uint16_t divider = std::stoul(strframes.substr(pos + 1));
|
||||
|
||||
return frames / divider;
|
||||
}
|
||||
|
@ -129,12 +129,12 @@ double Attachment::framerate() const
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
uint_fast64_t Attachment::height() const
|
||||
uint64_t Attachment::height() const
|
||||
{
|
||||
return get_uint64("meta.original.height");
|
||||
}
|
||||
|
||||
uint_fast64_t Attachment::height_small() const
|
||||
uint64_t Attachment::height_small() const
|
||||
{
|
||||
return get_uint64("meta.small.height");
|
||||
}
|
||||
|
@ -190,12 +190,12 @@ const string Attachment::url() const
|
|||
return get_string("url");
|
||||
}
|
||||
|
||||
uint_fast64_t Attachment::width() const
|
||||
uint64_t Attachment::width() const
|
||||
{
|
||||
return get_uint64("meta.original.width");
|
||||
}
|
||||
|
||||
uint_fast64_t Attachment::width_small() const
|
||||
uint64_t Attachment::width_small() const
|
||||
{
|
||||
return get_uint64("meta.small.width");
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
|
||||
namespace Mastodon
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t bitrate() const;
|
||||
uint64_t bitrate() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the image description
|
||||
|
@ -150,14 +150,14 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t height() const;
|
||||
uint64_t height() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the height of the preview image
|
||||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t height_small() const;
|
||||
uint64_t height_small() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the ID of the attachment
|
||||
|
@ -220,14 +220,14 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t width() const;
|
||||
uint64_t width() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the width of the preview image
|
||||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t width_small() const;
|
||||
uint64_t width_small() const;
|
||||
|
||||
|
||||
};
|
||||
|
|
|
@ -56,7 +56,7 @@ const string Card::description() const
|
|||
return get_string("description");
|
||||
}
|
||||
|
||||
uint_fast64_t Card::height() const
|
||||
uint64_t Card::height() const
|
||||
{
|
||||
return get_uint64("height");
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ const string Card::url() const
|
|||
return get_string("url");
|
||||
}
|
||||
|
||||
uint_fast64_t Card::width() const
|
||||
uint64_t Card::width() const
|
||||
{
|
||||
return get_uint64("width");
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
|
||||
namespace Mastodon
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t height() const;
|
||||
uint64_t height() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the HTML
|
||||
|
@ -142,7 +142,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t width() const;
|
||||
uint64_t width() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -94,9 +94,9 @@ const string Instance::streaming_api() const
|
|||
return get_string("urls.streaming_api");
|
||||
}
|
||||
|
||||
uint_fast64_t Instance::max_toot_chars() const
|
||||
uint64_t Instance::max_toot_chars() const
|
||||
{
|
||||
const uint_fast64_t max_chars = get_uint64("max_toot_chars");
|
||||
const uint64_t max_chars = get_uint64("max_toot_chars");
|
||||
if (was_set())
|
||||
{
|
||||
return max_chars;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
|
||||
// If we are compiling mastodon-cpp, use another include path
|
||||
#ifdef MASTODON_CPP
|
||||
|
@ -129,7 +129,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since 0.20.0
|
||||
*/
|
||||
uint_fast64_t max_toot_chars() const;
|
||||
uint64_t max_toot_chars() const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
using namespace Mastodon;
|
||||
using List = Easy::List;
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
|
||||
List::List(const string &json)
|
||||
: Entity(json)
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
|
||||
namespace Mastodon
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
using std::chrono::system_clock;
|
||||
|
||||
namespace Mastodon
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
using std::chrono::system_clock;
|
||||
|
||||
namespace Mastodon
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
|
||||
namespace Mastodon
|
||||
{
|
||||
|
|
|
@ -122,7 +122,7 @@ bool Status::favourited() const
|
|||
return get_bool("favourited");
|
||||
}
|
||||
|
||||
uint_fast64_t Status::favourites_count() const
|
||||
uint64_t Status::favourites_count() const
|
||||
{
|
||||
return get_uint64("favourites_count");
|
||||
}
|
||||
|
@ -231,12 +231,12 @@ bool Status::reblogged() const
|
|||
return get_bool("reblogged");
|
||||
}
|
||||
|
||||
uint_fast64_t Status::reblogs_count() const
|
||||
uint64_t Status::reblogs_count() const
|
||||
{
|
||||
return get_uint64("reblogs_count");
|
||||
}
|
||||
|
||||
uint_fast64_t Status::replies_count() const
|
||||
uint64_t Status::replies_count() const
|
||||
{
|
||||
return get_uint64("replies_count");
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#endif
|
||||
|
||||
using std::string;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
using std::chrono::system_clock;
|
||||
|
||||
namespace Mastodon
|
||||
|
@ -138,7 +138,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t favourites_count() const;
|
||||
uint64_t favourites_count() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the ID of the status
|
||||
|
@ -237,14 +237,14 @@ namespace Mastodon
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast64_t reblogs_count() const;
|
||||
uint64_t reblogs_count() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns the number of replies for the status
|
||||
*
|
||||
* @since 0.19.0
|
||||
*/
|
||||
uint_fast64_t replies_count() const;
|
||||
uint64_t replies_count() const;
|
||||
|
||||
/*!
|
||||
* @brief Returns true if the attachments should be hidden by default
|
||||
|
|
|
@ -89,7 +89,7 @@ bool Tag::History::valid() const
|
|||
return Entity::check_valid(attributes);
|
||||
}
|
||||
|
||||
uint_fast64_t Tag::History::accounts()
|
||||
uint64_t Tag::History::accounts()
|
||||
{
|
||||
return stouint64(get_string("accounts"));
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ const system_clock::time_point Tag::History::day()
|
|||
return system_clock::time_point();
|
||||
}
|
||||
|
||||
uint_fast64_t Tag::History::uses()
|
||||
uint64_t Tag::History::uses()
|
||||
{
|
||||
return stouint64(get_string("uses"));
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
using std::string;
|
||||
using std::chrono::system_clock;
|
||||
using std::uint_fast64_t;
|
||||
using std::uint64_t;
|
||||
|
||||
namespace Mastodon
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since 0.16.0
|
||||
*/
|
||||
uint_fast64_t accounts();
|
||||
uint64_t accounts();
|
||||
|
||||
/*!
|
||||
* @brief Returns the day.
|
||||
|
@ -89,7 +89,7 @@ namespace Mastodon
|
|||
*
|
||||
* @since 0.16.0
|
||||
*/
|
||||
uint_fast64_t uses();
|
||||
uint64_t uses();
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
|
@ -145,7 +145,7 @@ const string Easy::Entity::get_string(const string &key) const
|
|||
return "";
|
||||
}
|
||||
|
||||
uint_fast64_t Easy::Entity::get_uint64(const string &key) const
|
||||
uint64_t Easy::Entity::get_uint64(const string &key) const
|
||||
{
|
||||
const Json::Value node = get(key);
|
||||
|
||||
|
@ -264,7 +264,7 @@ void Easy::Entity::set(const string &key, const Json::Value &value)
|
|||
ttdebug << "Could not set data: " << key << '\n';
|
||||
}
|
||||
|
||||
std::uint_fast64_t Easy::Entity::stouint64(const string &str) const
|
||||
std::uint64_t Easy::Entity::stouint64(const string &str) const
|
||||
{
|
||||
if (str == "")
|
||||
{
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
|
||||
using namespace Mastodon;
|
||||
|
||||
const Easy::Status Easy::send_toot(const Status &status, uint_fast16_t &error)
|
||||
const Easy::Status Easy::send_toot(const Status &status, uint16_t &error)
|
||||
{
|
||||
return send_post(status, error);
|
||||
}
|
||||
|
||||
const Easy::Status Easy::send_post(const Status &status, uint_fast16_t &error)
|
||||
const Easy::Status Easy::send_post(const Status &status, uint16_t &error)
|
||||
{
|
||||
API::parametermap parameters;
|
||||
string answer;
|
||||
|
@ -139,7 +139,7 @@ const Easy::Status Easy::send_post(const Status &status, uint_fast16_t &error)
|
|||
}
|
||||
|
||||
const vector<Easy::Notification> Easy::get_notifications(
|
||||
uint_fast16_t &error, const uint_fast16_t limit,
|
||||
uint16_t &error, const uint16_t limit,
|
||||
const string since_id, const string max_id)
|
||||
{
|
||||
API::parametermap parameters;
|
||||
|
|
|
@ -44,21 +44,21 @@ API::http::~http()
|
|||
curlpp::terminate();
|
||||
}
|
||||
|
||||
uint_fast16_t API::http::request(const method &meth,
|
||||
uint16_t API::http::request(const method &meth,
|
||||
const string &path,
|
||||
string &answer)
|
||||
{
|
||||
return request(meth, path, curlpp::Forms(), answer);
|
||||
}
|
||||
|
||||
uint_fast16_t API::http::request(const method &meth,
|
||||
uint16_t API::http::request(const method &meth,
|
||||
const string &path,
|
||||
const curlpp::Forms &formdata,
|
||||
string &answer)
|
||||
{
|
||||
using namespace std::placeholders; // _1, _2, _3
|
||||
|
||||
uint_fast16_t ret = 0;
|
||||
uint16_t ret = 0;
|
||||
ttdebug << "Path is: " << path << '\n';
|
||||
|
||||
try
|
||||
|
|
|
@ -148,7 +148,7 @@ const std::string API::urldecode(const std::string &str)
|
|||
return curlpp::unescape(str);
|
||||
}
|
||||
|
||||
uint_fast16_t API::register_app1(const string &client_name,
|
||||
uint16_t API::register_app1(const string &client_name,
|
||||
const string &redirect_uri,
|
||||
const string &scopes,
|
||||
const string &website,
|
||||
|
@ -165,7 +165,7 @@ uint_fast16_t API::register_app1(const string &client_name,
|
|||
};
|
||||
|
||||
string answer;
|
||||
uint_fast16_t ret = post(API::v1::apps, parameters, answer);
|
||||
uint16_t ret = post(API::v1::apps, parameters, answer);
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ uint_fast16_t API::register_app1(const string &client_name,
|
|||
|
||||
}
|
||||
|
||||
uint_fast16_t API::register_app2(const string &client_id,
|
||||
uint16_t API::register_app2(const string &client_id,
|
||||
const string &client_secret,
|
||||
const string &redirect_uri,
|
||||
const string &code,
|
||||
|
@ -218,7 +218,7 @@ uint_fast16_t API::register_app2(const string &client_id,
|
|||
};
|
||||
|
||||
std::string answer;
|
||||
uint_fast16_t ret = post("/oauth/token", parameters, answer);
|
||||
uint16_t ret = post("/oauth/token", parameters, answer);
|
||||
if (ret == 0)
|
||||
{
|
||||
std::smatch match;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <curlpp/cURLpp.hpp>
|
||||
#include <curlpp/Easy.hpp>
|
||||
|
||||
using std::uint_fast16_t;
|
||||
using std::uint16_t;
|
||||
using std::string;
|
||||
|
||||
/*!
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
explicit http(const API &api, const string &instance,
|
||||
const string &access_token);
|
||||
~http();
|
||||
uint_fast16_t request(const method &meth,
|
||||
uint16_t request(const method &meth,
|
||||
const string &path,
|
||||
string &answer);
|
||||
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t request(const method &meth,
|
||||
uint16_t request(const method &meth,
|
||||
const string &path,
|
||||
const curlpp::Forms &formdata,
|
||||
string &answer);
|
||||
|
@ -369,7 +369,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t register_app1(const string &client_name,
|
||||
uint16_t register_app1(const string &client_name,
|
||||
const string &redirect_uri,
|
||||
const string &scopes,
|
||||
const string &website,
|
||||
|
@ -393,7 +393,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t register_app2(const string &client_id,
|
||||
uint16_t register_app2(const string &client_id,
|
||||
const string &client_secret,
|
||||
const string &redirect_uri,
|
||||
const string &code,
|
||||
|
@ -472,7 +472,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t get(const Mastodon::API::v1 &call, string &answer);
|
||||
uint16_t get(const Mastodon::API::v1 &call, string &answer);
|
||||
|
||||
/*!
|
||||
* @brief Make a GET request which requires parameters.
|
||||
|
@ -485,7 +485,7 @@ public:
|
|||
* @return @ref error "Error code". If the URL has permanently changed, 13
|
||||
* is returned and answer is set to the new URL.
|
||||
*/
|
||||
uint_fast16_t get(const Mastodon::API::v1 &call,
|
||||
uint16_t get(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
@ -494,7 +494,7 @@ public:
|
|||
*
|
||||
* @since 0.16.0
|
||||
*/
|
||||
uint_fast16_t get(const Mastodon::API::v2 &call,
|
||||
uint16_t get(const Mastodon::API::v2 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
@ -510,7 +510,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t get(const string &call, string &answer);
|
||||
uint16_t get(const string &call, string &answer);
|
||||
|
||||
/*!
|
||||
* @brief Make a streaming GET request.
|
||||
|
@ -526,7 +526,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t get_stream(const Mastodon::API::v1 &call,
|
||||
uint16_t get_stream(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr);
|
||||
|
@ -544,7 +544,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t get_stream(const Mastodon::API::v1 &call,
|
||||
uint16_t get_stream(const Mastodon::API::v1 &call,
|
||||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr);
|
||||
|
||||
|
@ -562,7 +562,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t get_stream(const string &call,
|
||||
uint16_t get_stream(const string &call,
|
||||
string &answer,
|
||||
std::unique_ptr<Mastodon::API::http> &ptr);
|
||||
|
||||
|
@ -581,7 +581,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t patch(const Mastodon::API::v1 &call,
|
||||
uint16_t patch(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
@ -597,7 +597,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t post(const Mastodon::API::v1 &call, string &answer);
|
||||
uint16_t post(const Mastodon::API::v1 &call, string &answer);
|
||||
|
||||
/*!
|
||||
* @brief Make a POST request which requires parameters.
|
||||
|
@ -614,7 +614,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t post(const Mastodon::API::v1 &call,
|
||||
uint16_t post(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
@ -633,7 +633,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t post(const string &call,
|
||||
uint16_t post(const string &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
@ -651,7 +651,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t put(const Mastodon::API::v1 &call,
|
||||
uint16_t put(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
@ -669,7 +669,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t put(const string &call,
|
||||
uint16_t put(const string &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
@ -683,7 +683,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t del(const Mastodon::API::v1 &call,
|
||||
uint16_t del(const Mastodon::API::v1 &call,
|
||||
const parametermap ¶meters);
|
||||
|
||||
/*!
|
||||
|
@ -699,7 +699,7 @@ public:
|
|||
*
|
||||
* @since before 0.11.0
|
||||
*/
|
||||
uint_fast16_t del(const string &call,
|
||||
uint16_t del(const string &call,
|
||||
const parametermap ¶meters,
|
||||
string &answer);
|
||||
|
||||
|
|
Reference in New Issue