mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 16:57:16 +01:00
4a6bfc086c
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
32 lines
853 B
C++
32 lines
853 B
C++
#ifndef CPR_AUTH_H
|
|
#define CPR_AUTH_H
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
|
|
|
namespace cpr {
|
|
|
|
class Authentication {
|
|
public:
|
|
Authentication(const std::string& username, const std::string& password)
|
|
: auth_string_{username + ":" + password} {}
|
|
Authentication(std::string&& username, std::string&& password)
|
|
: auth_string_{std::move(username) + ":" + std::move(password)} {}
|
|
Authentication(const Authentication& other) = default;
|
|
Authentication(Authentication&& old) noexcept = default;
|
|
virtual ~Authentication() noexcept = default;
|
|
|
|
Authentication& operator=(Authentication&& old) noexcept = default;
|
|
Authentication& operator=(const Authentication& other) = default;
|
|
|
|
virtual const char* GetAuthString() const noexcept;
|
|
|
|
protected:
|
|
std::string auth_string_;
|
|
};
|
|
|
|
} // namespace cpr
|
|
|
|
#endif
|