LicenseSpring C++ SDK 7.31.0
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
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.
 
 LicenseType (int type)
 Constructs LicenseType given an int.
 
 LicenseType (LSLicenseType type)
 Constructs LicenseType with given type.
 
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.
 
std::string toFormattedString () const
 Converts a LicenseType to a string with first letter capitalized.
 

Static Public Member Functions

static LicenseType fromString (const std::string &str)
 Converts string to a LicenseType.
 

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

◆ LicenseType() [1/3]

LicenseSpring::LicenseType::LicenseType ( )

Constructs LicenseType with type LicenseTypeUnknown.

◆ LicenseType() [2/3]

LicenseSpring::LicenseType::LicenseType ( int  type)

Constructs LicenseType given an int.

Parameters
typean int corresponding to the LicenseType

◆ LicenseType() [3/3]

LicenseSpring::LicenseType::LicenseType ( LSLicenseType  type)

Constructs LicenseType with given type.

Parameters
typethe type of license given to LicenseType

Member Function Documentation

◆ fromString()

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.

◆ operator==() [1/2]

bool LicenseSpring::LicenseType::operator== ( LicenseType  t) const

◆ operator!=() [1/2]

bool LicenseSpring::LicenseType::operator!= ( LicenseType  t) const

◆ operator==() [2/2]

bool LicenseSpring::LicenseType::operator== ( LSLicenseType  t) const

◆ operator!=() [2/2]

bool LicenseSpring::LicenseType::operator!= ( LSLicenseType  t) const

◆ operator LSLicenseType()

LicenseSpring::LicenseType::operator LSLicenseType ( ) const

◆ operator int()

LicenseSpring::LicenseType::operator int ( ) const

◆ toString()

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.

◆ toFormattedString()

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: