LicenseSpring C++ SDK
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
LicenseMemoryStorage.h
Go to the documentation of this file.
1#ifndef LS_LICENSE_MEMORY_STORAGE_H
2#define LS_LICENSE_MEMORY_STORAGE_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning(push)
7#pragma warning(disable : 4251)
8#endif
9
10#include <mutex>
11#include <string>
12#include "LicenseStorage.h"
13
14namespace LicenseSpring
15{
20{
21public:
22 using ptr_t = std::shared_ptr<LicenseMemoryStorage>;
23
28 static ptr_t create();
29
32
35 void saveLicense(const std::string &licenseData);
36
39 std::string loadLicense();
40
42 void clear();
43
44private:
45 std::string m_licenseData;
46 std::mutex m_mutex;
47};
48} // namespace LicenseSpring
49
50#ifdef _MSC_VER
51#pragma warning(pop)
52#endif
53
54#endif // LS_LICENSE_MEMORY_STORAGE_H
#define LS_API
Definition APIDef.h:23
Simple class that saves license in a variable, implements LicenseStorage interface.
std::shared_ptr< LicenseMemoryStorage > ptr_t
std::string loadLicense()
Load license data from memory (variable).
void saveLicense(const std::string &licenseData)
Saves license data in a variable.
void clear()
Purge license data.
LicenseMemoryStorage()=default
Constructor for LicenseMemoryStorage object.
static ptr_t create()
Allocates and constructs a LicenseMemoryStorage object and passes args to LicenseMemoryStorage().
LicenseStorage interface.