![]() |
LicenseSpring C++ SDK
7.31.0
Easily add Software Licensing to your application
|
Class used for encapsulating the type of license, comparing types of licenses, and converting them to strings. More...
#include <LicenseSpring/LicenseType.h>
Public Member Functions | |
LicenseType () | |
Constructs LicenseType with type LicenseTypeUnknown. More... | |
LicenseType (int type) | |
Constructs LicenseType given an int. More... | |
LicenseType (LSLicenseType type) | |
Constructs LicenseType with given type. More... | |
bool | operator== (LicenseType t) const |
bool | operator!= (LicenseType t) const |
bool | operator== (LSLicenseType t) const |
bool | operator!= (LSLicenseType t) const |
operator LSLicenseType () const | |
operator int () const | |
std::string | toString () const |
Converts a LicenseType to a string. More... | |
std::string | toFormattedString () const |
Converts a LicenseType to a string with first letter capitalized. More... | |
Static Public Member Functions | |
static LicenseType | fromString (const std::string &str) |
Converts string to a LicenseType. More... | |
Class used for encapsulating the type of license, comparing types of licenses, and converting them to strings.
Can be perpetual, subscription, time-limited, or consumption.
Definition at line 18 of file LicenseType.h.
LicenseSpring::LicenseType::LicenseType | ( | ) |
Constructs LicenseType with type LicenseTypeUnknown.
LicenseSpring::LicenseType::LicenseType | ( | int | type | ) |
Constructs LicenseType given an int.
type | an int corresponding to the LicenseType |
LicenseSpring::LicenseType::LicenseType | ( | LSLicenseType | type | ) |
Constructs LicenseType with given type.
type | the type of license given to LicenseType |
|
static |
Converts string to a LicenseType.
Available strings with corresponding conversions:
'perpetual', 'subscription', 'time-limited', 'consumption'.
Must be all lowercase. Any other string will return LicenseTypeUnknown.
str | String to convert into a LicenseType |
bool LicenseSpring::LicenseType::operator== | ( | LicenseType | t | ) | const |
bool LicenseSpring::LicenseType::operator!= | ( | LicenseType | t | ) | const |
bool LicenseSpring::LicenseType::operator== | ( | LSLicenseType | t | ) | const |
bool LicenseSpring::LicenseType::operator!= | ( | LSLicenseType | t | ) | const |
LicenseSpring::LicenseType::operator LSLicenseType | ( | ) | const |
LicenseSpring::LicenseType::operator int | ( | ) | const |
std::string LicenseSpring::LicenseType::toString | ( | ) | const |
Converts a LicenseType to a string.
Possible strings that can be returned include:
'perpetual', 'subscription', 'time-limited', 'consumption' or 'Unknown'.
std::string LicenseSpring::LicenseType::toFormattedString | ( | ) | const |
Converts a LicenseType to a string with first letter capitalized.