7#pragma warning(disable : 4251)
42 const std::string &
id()
const;
47 const std::string &
key()
const;
52 const std::string &
user()
const;
99 const std::string &user,
const std::string &password = std::string(),
bool needTrim =
true);
120 const std::string &password = std::string(),
bool needTrim =
true);
135 std::string m_password;
Class that represents License identifier.
bool isEmpty() const
Checks if LicenseID is empty.
static LicenseID fromUser(const std::string &user, const std::string &password=std::string(), bool needTrim=true)
Constructs LicenseID with given user credentials.
void trim()
Remove trailing whitespaces from the end and beginning of ID (key or user and password).
const std::string & password() const
Returns user password or empty string, if password is not set.
const std::string & user() const
Returns user identifier or empty string, if user is not set (for example in case of key-based product...
static LicenseID fromUser(const char *user, uint64_t serverId, const char *password=nullptr)
Constructs LicenseID with given user credentials.
const std::string & id() const
Returns license key or user identifier, depending of what is present.
const std::string & key() const
Returns license key or empty string, if key is not set (for example in case of user-based product).
static LicenseID fromUser(const std::string &user, uint64_t serverId, const std::string &password=std::string(), bool needTrim=true)
Constructs LicenseID with given user credentials.
LicenseID()=default
Default constructor, constructs invalid (empty) LicenseID.
static LicenseID fromUser(const char *user, const char *password=nullptr)
Constructs LicenseID with given user credentials.
bool isValid() const
Checks if LicenseID is valid.
static LicenseID fromKey(const char *licenseKey)
Constructs LicenseID with given license key.
LicenseID(const LicenseID &)=default
Default copy constructor.
void setPassword(const std::string &password)
Sets user password accordingly to provided string.
static LicenseID fromKey(const std::string &licenseKey, bool needTrim=true)
Constructs LicenseID with given license key.
uint64_t serverId() const
Returns server-side license id, or 0 if license is key-based.