![]() |
LicenseSpring C++ SDK 7.31.0
Easily add Software Licensing to your application
|
Class that saves license in a file, derived from LicenseFileStorageBase
class.
More...
#include <LicenseSpring/LicenseFileStorage.h>
Public Types | |
using | ptr_t = std::shared_ptr< LicenseFileStorage > |
![]() | |
using | ptr_t = std::shared_ptr< LicenseFileStorageBase > |
![]() | |
using | ptr_t = std::shared_ptr< LicenseStorage > |
Public Member Functions | |
LicenseFileStorage (const std::wstring &licensePath=std::wstring()) | |
Constructor for LicenseFileStorage object. More... | |
void | saveLicense (const std::string &data) override |
Saves given license data string to the file. More... | |
std::string | loadLicense () override |
Load license from file. More... | |
void | clear () override |
Removes local license file. More... | |
![]() | |
LicenseFileStorageBase (const std::wstring &licensePath=std::wstring()) | |
Constructor for LicenseFileStorageBase object. More... | |
void | saveLicense (const std::string &data) override |
Saves given license data string to the file. More... | |
std::string | loadLicense () override |
Load license from file. More... | |
void | clear () override |
Removes local license file. More... | |
void | setLicenseFileName (const std::wstring &name) |
Setter for license filename with extension (optional). Default filename is License.key. More... | |
void | setLicenseFolderPath (const std::wstring &path) |
Setter for folder path where License file is being stored. More... | |
const std::wstring & | licenseFileName () const |
Getter for license filename with extension (optional). More... | |
const std::wstring & | licenseFolderPath () const |
Getter for folder path where License file is being stored. More... | |
std::wstring | licenseFilePath () const |
Getter for path to the license file. More... | |
![]() | |
virtual void | saveLicense (const std::string &licenseData)=0 |
Save license data somewhere. More... | |
virtual std::string | loadLicense ()=0 |
Load license data. More... | |
virtual void | clear ()=0 |
Removes local license data. More... | |
virtual | ~LicenseStorage () |
Destructor for LicenseStorage object. More... | |
Static Public Member Functions | |
static ptr_t | create (const std::wstring &licensePath=std::wstring()) |
Allocates and constructs a LicenseFileStorage object and passes args to LicenseFileStorage(). More... | |
![]() | |
static ptr_t | create (const std::wstring &licensePath=std::wstring()) |
Allocates and constructs a LicenseFileStorageBase object and passes args to LicenseFileStorageBase(). More... | |
Additional Inherited Members | |
![]() | |
std::wstring | prepareRead () const |
Prepare to read license file. More... | |
std::wstring | prepareWrite () const |
Prepare to write license file. More... | |
std::string | readLicense (const std::wstring &filePath) const |
Reads license from file. More... | |
void | writeLicense (const std::wstring &filePath, const std::string &data) const |
Writes given license data string to the file. More... | |
![]() | |
std::wstring | m_folderPath |
std::wstring | m_fileName |
Class that saves license in a file, derived from LicenseFileStorageBase
class.
This is the default license storage type. File operations of this class is thread safe.
Definition at line 93 of file LicenseFileStorage.h.
using LicenseSpring::LicenseFileStorage::ptr_t = std::shared_ptr<LicenseFileStorage> |
Definition at line 96 of file LicenseFileStorage.h.
LicenseSpring::LicenseFileStorage::LicenseFileStorage | ( | const std::wstring & | licensePath = std::wstring() | ) |
Constructor for LicenseFileStorage object.
licensePath | The path that license folder path will be set to |
|
static |
Allocates and constructs a LicenseFileStorage object and passes args to LicenseFileStorage().
licensePath | The path that license folder path will be set to |
|
overridevirtual |
Saves given license data string to the file.
data | License data string |
Reimplemented from LicenseSpring::LicenseFileStorageBase.
|
overridevirtual |
Load license from file.
Reimplemented from LicenseSpring::LicenseFileStorageBase.
|
overridevirtual |
Removes local license file.
Reimplemented from LicenseSpring::LicenseFileStorageBase.