LicenseSpring C++ SDK 7.31.0
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
LicenseSpring::LicenseFileStorage Class Reference

Class that saves license in a file, derived from LicenseFileStorageBase class. More...

#include <LicenseSpring/LicenseFileStorage.h>

Inheritance diagram for LicenseSpring::LicenseFileStorage:
LicenseSpring::LicenseFileStorageBase LicenseSpring::LicenseStorage

Public Types

using ptr_t = std::shared_ptr< LicenseFileStorage >
 
- Public Types inherited from LicenseSpring::LicenseFileStorageBase
using ptr_t = std::shared_ptr< LicenseFileStorageBase >
 
- Public Types inherited from LicenseSpring::LicenseStorage
using ptr_t = std::shared_ptr< LicenseStorage >
 

Public Member Functions

 LicenseFileStorage (const std::wstring &licensePath=std::wstring())
 Constructor for LicenseFileStorage object.
 
void saveLicense (const std::string &data) override
 Saves given license data string to the file.
 
std::string loadLicense () override
 Load license from file.
 
void clear () override
 Removes local license file.
 
- Public Member Functions inherited from LicenseSpring::LicenseFileStorageBase
 LicenseFileStorageBase (const std::wstring &licensePath=std::wstring())
 Constructor for LicenseFileStorageBase object.
 
void saveLicense (const std::string &data) override
 Saves given license data string to the file.
 
std::string loadLicense () override
 Load license from file.
 
void clear () override
 Removes local license file.
 
void setLicenseFileName (const std::wstring &name)
 Setter for license filename with extension (optional). Default filename is License.key.
 
void setLicenseFolderPath (const std::wstring &path)
 Setter for folder path where License file is being stored.
 
const std::wstring & licenseFileName () const
 Getter for license filename with extension (optional).
 
const std::wstring & licenseFolderPath () const
 Getter for folder path where License file is being stored.
 
std::wstring licenseFilePath () const
 Getter for path to the license file.
 
- Public Member Functions inherited from LicenseSpring::LicenseStorage
virtual ~LicenseStorage ()
 Destructor for LicenseStorage object.
 

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().
 
- Static Public Member Functions inherited from LicenseSpring::LicenseFileStorageBase
static ptr_t create (const std::wstring &licensePath=std::wstring())
 Allocates and constructs a LicenseFileStorageBase object and passes args to LicenseFileStorageBase().
 

Additional Inherited Members

- Protected Member Functions inherited from LicenseSpring::LicenseFileStorageBase
std::wstring prepareRead () const
 Prepare to read license file.
 
std::wstring prepareWrite () const
 Prepare to write license file.
 
std::string readLicense (const std::wstring &filePath) const
 Reads license from file.
 
void writeLicense (const std::wstring &filePath, const std::string &data) const
 Writes given license data string to the file.
 
- Protected Attributes inherited from LicenseSpring::LicenseFileStorageBase
std::wstring m_folderPath
 
std::wstring m_fileName
 

Detailed Description

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.

Member Typedef Documentation

◆ ptr_t

Constructor & Destructor Documentation

◆ LicenseFileStorage()

LicenseSpring::LicenseFileStorage::LicenseFileStorage ( const std::wstring &  licensePath = std::wstring())

Constructor for LicenseFileStorage object.

Parameters
licensePathThe path that license folder path will be set to

Member Function Documentation

◆ create()

static ptr_t LicenseSpring::LicenseFileStorage::create ( const std::wstring &  licensePath = std::wstring())
static

Allocates and constructs a LicenseFileStorage object and passes args to LicenseFileStorage().

Parameters
licensePathThe path that license folder path will be set to
Returns
A shared_ptr object that owns and stores a pointer to a newly allocated LicenseFileStorage object.

◆ saveLicense()

void LicenseSpring::LicenseFileStorage::saveLicense ( const std::string &  data)
overridevirtual

Saves given license data string to the file.

Parameters
dataLicense data string

Implements LicenseSpring::LicenseStorage.

◆ loadLicense()

std::string LicenseSpring::LicenseFileStorage::loadLicense ( )
overridevirtual

Load license from file.

Returns
Encrypted license data.

Implements LicenseSpring::LicenseStorage.

◆ clear()

void LicenseSpring::LicenseFileStorage::clear ( )
overridevirtual

Removes local license file.

Implements LicenseSpring::LicenseStorage.


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