diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/api.hpp | 2 | ||||
-rw-r--r-- | include/connection.hpp | 11 | ||||
-rw-r--r-- | include/curl_wrapper.hpp | 4 | ||||
-rw-r--r-- | include/instance.hpp | 4 |
4 files changed, 13 insertions, 8 deletions
diff --git a/include/api.hpp b/include/api.hpp index e508fa1..7c89af4 100644 --- a/include/api.hpp +++ b/include/api.hpp @@ -312,7 +312,7 @@ public: [[nodiscard]] inline string_view to_string_view() const { - return _endpoint_map.at(_endpoint).data(); + return _endpoint_map.at(_endpoint); } private: diff --git a/include/connection.hpp b/include/connection.hpp index 90027fb..fcb2a23 100644 --- a/include/connection.hpp +++ b/include/connection.hpp @@ -33,7 +33,12 @@ using std::string; using std::string_view; using std::variant; -using endpoint_variant = variant<API::endpoint_type,string>; +/*! + * @brief An endpoint. Either API::endpoint_type or `std::string_view`. + * + * @since 0.1.0 + */ +using endpoint_variant = variant<API::endpoint_type,string_view>; /*! * @brief Represents a connection to an instance. Used for requests. @@ -66,7 +71,7 @@ public: * })}; * @endcode * - * @param endpoint Endpoint as API::endpoint_type or `std::string`. + * @param endpoint Endpoint as API::endpoint_type or `std::string_view`. * @param parameters A map of parameters. * * @@ -83,7 +88,7 @@ public: * auto answer{connection.get("/api/v1/instance")}; * @endcode * - * @param endpoint Endpoint as API::endpoint_type or `std::string`. + * @param endpoint Endpoint as API::endpoint_type or `std::string_view`. * * @since 0.1.0 */ diff --git a/include/curl_wrapper.hpp b/include/curl_wrapper.hpp index 146e481..ecc30e1 100644 --- a/include/curl_wrapper.hpp +++ b/include/curl_wrapper.hpp @@ -58,13 +58,13 @@ enum class http_method * parametermap parameters * { * {"id", "12"}, - * {"poll[options]", vector<string>{"Yes", "No", "Maybe"}} + * {"poll[options]", vector<string_view>{"Yes", "No", "Maybe"}} * }; * @endcode * * @since 0.1.0 */ -using parametermap = map<string, variant<string, vector<string>>>; +using parametermap = map<string_view, variant<string_view, vector<string_view>>>; /*! * @brief Handles the details of network connections. diff --git a/include/instance.hpp b/include/instance.hpp index 914a470..cecb324 100644 --- a/include/instance.hpp +++ b/include/instance.hpp @@ -50,8 +50,8 @@ public: * * @since 0.1.0 */ - explicit Instance(const string_view &hostname, - const string_view &access_token); + explicit Instance(const string_view hostname, + const string_view access_token); /*! * @brief Returns the hostname. |