LicenseSpring C++ SDK  7.31.0
Easily add Software Licensing to your application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
LicenseSpring::LicenseType Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

LicenseSpring::LicenseType::LicenseType ( )

Constructs LicenseType with type LicenseTypeUnknown.

LicenseSpring::LicenseType::LicenseType ( int  type)

Constructs LicenseType given an int.

Parameters
typean int corresponding to the LicenseType
LicenseSpring::LicenseType::LicenseType ( LSLicenseType  type)

Constructs LicenseType with given type.

Parameters
typethe type of license given to LicenseType

Member Function Documentation

static LicenseType LicenseSpring::LicenseType::fromString ( const std::string &  str)
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.

Parameters
strString to convert into a LicenseType
Returns
LicenseType of corresponding string.
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'.

Returns
Corresponding string based on type.
std::string LicenseSpring::LicenseType::toFormattedString ( ) const

Converts a LicenseType to a string with first letter capitalized.

Returns
Same as (see toString()), but with first letter capitalized.

The documentation for this class was generated from the following file: