7#pragma warning( disable : 4251 )
39 const std::string&
id()
const;
43 const std::string&
key()
const;
47 const std::string&
user()
const;
83 static LicenseID fromUser(
const std::string& user,
const std::string& password = std::string(),
84 bool needTrim =
true );
97 std::string m_password;
102#pragma warning( pop )
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
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...
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).
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.