Merge branch 'develop' into main
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
commit
aea4b0f492
@ -57,20 +57,14 @@ public:
|
|||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
explicit Instance(const string_view hostname,
|
explicit Instance(string_view hostname, string_view access_token);
|
||||||
const string_view access_token)
|
|
||||||
: _hostname{hostname}
|
|
||||||
, _baseuri{"https://" + _hostname}
|
|
||||||
, _access_token{access_token}
|
|
||||||
, _max_chars{0}
|
|
||||||
{}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Copy constructor. A new CURLWrapper is constructed.
|
* @brief Copy constructor. A new CURLWrapper is constructed.
|
||||||
*
|
*
|
||||||
* @since 0.5.2
|
* @since 0.5.2
|
||||||
*/
|
*/
|
||||||
Instance(const Instance &other) = default;
|
Instance(const Instance &other);
|
||||||
|
|
||||||
//! Move constructor
|
//! Move constructor
|
||||||
Instance(Instance &&other) noexcept = delete;
|
Instance(Instance &&other) noexcept = delete;
|
||||||
@ -143,9 +137,10 @@ public:
|
|||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -31,6 +31,29 @@ using std::regex;
|
|||||||
using std::regex_search;
|
using std::regex_search;
|
||||||
using std::smatch;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
Instance::Instance(const Instance &other)
|
||||||
|
: CURLWrapper{other}
|
||||||
|
, _hostname{other._hostname}
|
||||||
|
, _baseuri{other._baseuri}
|
||||||
|
, _access_token{other._access_token}
|
||||||
|
, _max_chars{other._max_chars}
|
||||||
|
, _proxy{other._proxy}
|
||||||
|
, _post_formats{other._post_formats}
|
||||||
|
, _cainfo{other._cainfo}
|
||||||
|
, _useragent{other._useragent}
|
||||||
|
{
|
||||||
|
CURLWrapper::setup_connection_properties(_proxy, _access_token,
|
||||||
|
_cainfo, _useragent);
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t Instance::get_max_chars() noexcept
|
uint64_t Instance::get_max_chars() noexcept
|
||||||
{
|
{
|
||||||
constexpr uint64_t default_max_chars{500};
|
constexpr uint64_t default_max_chars{500};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user