| LicenseSpring C++ SDK 7.27.0 Easily add Software Licensing to your application

Public Member Functions | Static Public Member Functions | List of all members
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

## ◆ 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

  type | an int corresponding to the LicenseType

## ◆ LicenseType() [3/3]

LicenseSpring::LicenseType::LicenseType | ( | LSLicenseType | type | ) |

Constructs LicenseType with given type.

Parameters

  type | the 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

  str | String 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:

- LicenseSpring/LicenseType.h