Class that saves license in a file, derived from LicenseFileStorageBase
class.
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.
|
|
std::wstring | m_folderPath |
|
std::wstring | m_fileName |
|
Class that saves license in a file, derived from LicenseFileStorageBase
class.
Enhanced license file storage type for interprocess use. It uses boost named mutex for synchronization. File operations of this class is thread and process safe.
Definition at line 137 of file LicenseFileStorage.h.
◆ ptr_t
◆ LicenseFileStorageEx()
LicenseSpring::LicenseFileStorageEx::LicenseFileStorageEx |
( |
const std::string & | appName, |
|
|
const std::wstring & | licensePath = std::wstring() ) |
LicenseFileStorageEx constructor.
- Parameters
-
appName | Application name to be used for mutex name. |
licensePath | The path that license folder path will be set to |
◆ ~LicenseFileStorageEx()
LicenseSpring::LicenseFileStorageEx::~LicenseFileStorageEx |
( |
| ) |
|
|
override |
◆ create()
static ptr_t LicenseSpring::LicenseFileStorageEx::create |
( |
const std::string & | appName, |
|
|
const std::wstring & | licensePath = std::wstring() ) |
|
static |
Allocates and constructs a LicenseFileStorageEx object and passes args to LicenseFileStorageEx().
- Parameters
-
appName | Application name to be used for mutex name. |
licensePath | The path that license folder path will be set to |
- Returns
- A shared_ptr object that owns and stores a pointer to a newly allocated LicenseFileStorageEx object.
◆ saveLicense()
void LicenseSpring::LicenseFileStorageEx::saveLicense |
( |
const std::string & | data | ) |
|
|
overridevirtual |
◆ loadLicense()
std::string LicenseSpring::LicenseFileStorageEx::loadLicense |
( |
| ) |
|
|
overridevirtual |
◆ clear()
void LicenseSpring::LicenseFileStorageEx::clear |
( |
| ) |
|
|
overridevirtual |
◆ setPermissionsUnix()
void LicenseSpring::LicenseFileStorageEx::setPermissionsUnix |
( |
int | permissions | ) |
|
Set platform dependent permission (Unix like systems).
- Parameters
-
permissions | Permissions to be set |
◆ setPermissionsWin()
void LicenseSpring::LicenseFileStorageEx::setPermissionsWin |
( |
void * | permissions | ) |
|
◆ setPermissionsUnrestricted()
void LicenseSpring::LicenseFileStorageEx::setPermissionsUnrestricted |
( |
| ) |
|
Sets permissions to unrestricted access: null DACL for windows or 0666 for UNIX.
◆ setPermissionsDefault()
void LicenseSpring::LicenseFileStorageEx::setPermissionsDefault |
( |
| ) |
|
Sets permissions to default values: null security attributes pointer for Windows or 0644 for UNIX.
This is the default value of the mutex permission.
◆ lockTimeout()
uint32_t LicenseSpring::LicenseFileStorageEx::lockTimeout |
( |
| ) |
const |
Get trylock timeout in milliseconds.
Default value is 1500ms, min is 50ms.
After timeout the SDK will try to remove mutex from the system and lock it again.
- Returns
- Timeout in milliseconds.
◆ setLockTimeout()
void LicenseSpring::LicenseFileStorageEx::setLockTimeout |
( |
uint32_t | timeout | ) |
|
Set timeout in milliseconds for trylock.
- Parameters
-
timeout | Timeout in milliseconds |
The documentation for this class was generated from the following file: