Base class that saves license in a file, implements ILicenseStorage
interface.
More...
#include <LicenseSpring/LicenseFileStorage.h>
|
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.
|
|
Base class that saves license in a file, implements ILicenseStorage
interface.
This class does not use any techniques for file access synchronization so it is not thread safe.
Definition at line 27 of file LicenseFileStorage.h.
◆ ptr_t
◆ LicenseFileStorageBase()
LicenseSpring::LicenseFileStorageBase::LicenseFileStorageBase |
( |
const std::wstring & | licensePath = std::wstring() | ) |
|
Constructor for LicenseFileStorageBase object.
- Parameters
-
licensePath | The path that license folder path will be set to |
◆ create()
static ptr_t LicenseSpring::LicenseFileStorageBase::create |
( |
const std::wstring & | licensePath = std::wstring() | ) |
|
|
static |
◆ saveLicense()
void LicenseSpring::LicenseFileStorageBase::saveLicense |
( |
const std::string & | data | ) |
|
|
overridevirtual |
◆ loadLicense()
std::string LicenseSpring::LicenseFileStorageBase::loadLicense |
( |
| ) |
|
|
overridevirtual |
◆ clear()
void LicenseSpring::LicenseFileStorageBase::clear |
( |
| ) |
|
|
overridevirtual |
◆ setLicenseFileName()
void LicenseSpring::LicenseFileStorageBase::setLicenseFileName |
( |
const std::wstring & | name | ) |
|
Setter for license filename with extension (optional). Default filename is License.key.
- Parameters
-
◆ setLicenseFolderPath()
void LicenseSpring::LicenseFileStorageBase::setLicenseFolderPath |
( |
const std::wstring & | path | ) |
|
Setter for folder path where License file is being stored.
- Parameters
-
path | New license folder path |
◆ licenseFileName()
const std::wstring & LicenseSpring::LicenseFileStorageBase::licenseFileName |
( |
| ) |
const |
Getter for license filename with extension (optional).
Default filename is License.key.
- Returns
- License filename with extension.
◆ licenseFolderPath()
const std::wstring & LicenseSpring::LicenseFileStorageBase::licenseFolderPath |
( |
| ) |
const |
Getter for folder path where License file is being stored.
- Returns
- License folder path.
◆ licenseFilePath()
std::wstring LicenseSpring::LicenseFileStorageBase::licenseFilePath |
( |
| ) |
const |
Getter for path to the license file.
- Returns
- Absolute path to the license file.
◆ prepareRead()
std::wstring LicenseSpring::LicenseFileStorageBase::prepareRead |
( |
| ) |
const |
|
protected |
Prepare to read license file.
- Returns
- Absolute path to the license file or empty string if file does not exist.
◆ prepareWrite()
std::wstring LicenseSpring::LicenseFileStorageBase::prepareWrite |
( |
| ) |
const |
|
protected |
Prepare to write license file.
Also creates corresponding folders if they do not exist.
- Returns
- Absolute path to the license file.
◆ readLicense()
std::string LicenseSpring::LicenseFileStorageBase::readLicense |
( |
const std::wstring & | filePath | ) |
const |
|
protected |
Reads license from file.
- Parameters
-
filePath | Absolute path to the license file |
- Returns
- Encrypted license data.
◆ writeLicense()
void LicenseSpring::LicenseFileStorageBase::writeLicense |
( |
const std::wstring & | filePath, |
|
|
const std::string & | data ) const |
|
protected |
Writes given license data string to the file.
- Parameters
-
filePath | Absolute path to the license file |
data | License data string |
◆ m_folderPath
std::wstring LicenseSpring::LicenseFileStorageBase::m_folderPath |
|
protected |
◆ m_fileName
std::wstring LicenseSpring::LicenseFileStorageBase::m_fileName |
|
protected |
The documentation for this class was generated from the following file: