Merge branch 'develop' into main
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
7917d94248
|
@ -14,8 +14,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef MASTODONPP_RETURN_TYPES_HPP
|
||||
#define MASTODONPP_RETURN_TYPES_HPP
|
||||
#ifndef MASTODONPP_ANSWER_HPP
|
||||
#define MASTODONPP_ANSWER_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
@ -34,7 +34,7 @@ using std::string_view;
|
|||
*
|
||||
* @since 0.1.0
|
||||
*
|
||||
* @headerfile return_types.hpp mastodonpp/return_types.hpp
|
||||
* @headerfile answer.hpp mastodonpp/answer.hpp
|
||||
*
|
||||
*/
|
||||
struct answer_type
|
||||
|
@ -103,4 +103,4 @@ struct answer_type
|
|||
|
||||
} // namespace mastodonpp
|
||||
|
||||
#endif // MASTODONPP_RETURN_TYPES_HPP
|
||||
#endif // MASTODONPP_ANSWER_HPP
|
|
@ -17,10 +17,10 @@
|
|||
#ifndef MASTODONPP_CONNECTION_HPP
|
||||
#define MASTODONPP_CONNECTION_HPP
|
||||
|
||||
#include "answer.hpp"
|
||||
#include "api.hpp"
|
||||
#include "curl_wrapper.hpp"
|
||||
#include "instance.hpp"
|
||||
#include "return_types.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
|
|
@ -17,18 +17,24 @@
|
|||
#ifndef MASTODONPP_CURL_WRAPPER_HPP
|
||||
#define MASTODONPP_CURL_WRAPPER_HPP
|
||||
|
||||
#include "return_types.hpp"
|
||||
#include "answer.hpp"
|
||||
|
||||
#include "curl/curl.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
namespace mastodonpp
|
||||
{
|
||||
|
||||
using std::map;
|
||||
using std::string;
|
||||
using std::string_view;
|
||||
using std::variant;
|
||||
using std::vector;
|
||||
|
||||
/*!
|
||||
* @brief The HTTP method.
|
||||
|
@ -44,6 +50,22 @@ enum class http_method
|
|||
DELETE
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief std::map of parameters for API calls.
|
||||
*
|
||||
* Example:
|
||||
* @code
|
||||
* parametermap parameters
|
||||
* {
|
||||
* {"id", "12"},
|
||||
* {"poll[options]", vector<string>{"Yes", "No", "Maybe"}}
|
||||
* };
|
||||
* @endcode
|
||||
*
|
||||
* @since 0.1.0
|
||||
*/
|
||||
using parametermap = map<string, variant<string, vector<string>>>;
|
||||
|
||||
/*!
|
||||
* @brief Handles the details of network connections.
|
||||
*
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
#ifndef MASTODONPP_HPP
|
||||
#define MASTODONPP_HPP
|
||||
|
||||
#include "answer.hpp"
|
||||
#include "api.hpp"
|
||||
#include "connection.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "instance.hpp"
|
||||
#include "return_types.hpp"
|
||||
|
||||
/*!
|
||||
* @headerfile mastodonpp.hpp mastodonpp/mastodonpp.hpp
|
||||
|
@ -72,6 +72,8 @@
|
|||
* Any unrecoverable libcurl error will be thrown as a
|
||||
* mastodonpp::CURLException. Network errors will **not** be thrown, but
|
||||
* reported via the return value.
|
||||
*
|
||||
* @example example01_instance_info.cpp
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "return_types.hpp"
|
||||
#include "answer.hpp"
|
||||
|
||||
namespace mastodonpp
|
||||
{
|
|
@ -14,9 +14,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "answer.hpp"
|
||||
#include "instance.hpp"
|
||||
#include "log.hpp"
|
||||
#include "return_types.hpp"
|
||||
|
||||
namespace mastodonpp
|
||||
{
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace mastodonpp
|
|||
using std::cerr;
|
||||
using std::string_view;
|
||||
|
||||
//! @private
|
||||
constexpr auto shorten_filename(const string_view &filename)
|
||||
{
|
||||
for (const string_view &dir : {"/src/", "/include/"})
|
||||
|
|
Loading…
Reference in New Issue
Block a user