Set access token in CURLWrapper too if it is set in Instance.

This commit is contained in:
tastytea 2020-03-21 11:18:22 +01:00
parent b5144fd9ce
commit 251d8a975c
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 12 additions and 9 deletions

View File

@ -57,13 +57,7 @@ public:
*
* @since 0.1.0
*/
explicit Instance(const string_view hostname,
const string_view access_token)
: _hostname{hostname}
, _baseuri{"https://" + _hostname}
, _access_token{access_token}
, _max_chars{0}
{}
explicit Instance(string_view hostname, string_view access_token);
/*!
* @brief Copy constructor. A new CURLWrapper is constructed.
@ -143,9 +137,10 @@ public:
*
* @since 0.1.0
*/
inline void set_access_token(string access_token)
inline void set_access_token(const string_view access_token)
{
_access_token = move(access_token);
_access_token = access_token;
CURLWrapper::set_access_token(access_token);
}
/*!

View File

@ -31,6 +31,14 @@ using std::regex;
using std::regex_search;
using std::smatch;
Instance::Instance(const string_view hostname, const string_view access_token)
: _hostname{hostname}
, _baseuri{"https://" + _hostname}
, _max_chars{0}
{
set_access_token(access_token);
}
uint64_t Instance::get_max_chars() noexcept
{
constexpr uint64_t default_max_chars{500};