diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/api.hpp | 11 | ||||
-rw-r--r-- | include/connection.hpp | 1 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/api.hpp b/include/api.hpp index 009d902..d22c3d2 100644 --- a/include/api.hpp +++ b/include/api.hpp @@ -24,6 +24,7 @@ namespace mastodonpp { +using std::map; using std::string_view; using std::variant; @@ -240,7 +241,7 @@ public: * * @since 0.1.0 */ - explicit API(const endpoint_type &endpoint); + explicit API(); /*! * @brief Convert #endpoint_type to `std::string_view`. @@ -248,10 +249,14 @@ public: * @since 0.1.0 */ [[nodiscard]] - string_view to_string_view() const; + inline string_view endpoint_to_string_view(const endpoint_type &endpoint) + const + { + return _endpoint_map.at(endpoint).data(); + } private: - const endpoint_type _endpoint; + const map<endpoint_type,string_view> _endpoint_map; }; } // namespace mastodonpp diff --git a/include/connection.hpp b/include/connection.hpp index a26120c..1a6c11f 100644 --- a/include/connection.hpp +++ b/include/connection.hpp @@ -74,6 +74,7 @@ public: private: Instance &_instance; const string_view _baseuri; + const API _api; }; } // namespace mastodonpp |