LicenseSpring C++ SDK
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
LicenseType.h
Go to the documentation of this file.
1#ifndef LS_LICENSE_TYPE_H
2#define LS_LICENSE_TYPE_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning(push)
7#pragma warning(disable : 4251)
8#endif
9
10#include <string>
11#include "APIDef.h"
12#include "PODTypes.h"
13
14namespace LicenseSpring
15{
20{
21public:
28 static LicenseType fromString(const std::string &str);
29
32
35 LicenseType(int type);
36
40
41 bool operator==(LicenseType t) const;
42 bool operator!=(LicenseType t) const;
45 operator LSLicenseType() const;
46 operator int() const;
47
52 std::string toString() const;
53
56 std::string toFormattedString() const;
57
58private:
59 LSLicenseType m_type;
60};
61} // namespace LicenseSpring
62
63#ifdef _MSC_VER
64#pragma warning(pop)
65#endif
66
67#endif // LS_LICENSE_TYPE_H
#define LS_API
Definition APIDef.h:23
LSLicenseType
License type.
Definition PODTypes.h:26
Class used for encapsulating the type of license, comparing types of licenses, and converting them to...
Definition LicenseType.h:20
bool operator==(LSLicenseType t) const
bool operator!=(LSLicenseType t) const
std::string toFormattedString() const
Converts a LicenseType to a string with first letter capitalized.
std::string toString() const
Converts a LicenseType to a string.
bool operator!=(LicenseType t) const
bool operator==(LicenseType t) const
LicenseType(LSLicenseType type)
Constructs LicenseType with given type.
LicenseType(int type)
Constructs LicenseType given an int.
LicenseType()
Constructs LicenseType with type LicenseTypeUnknown.
static LicenseType fromString(const std::string &str)
Converts string to a LicenseType.