LicenseSpring C++ SDK
Easily add Software Licensing to your application
Loading...
Searching...
No Matches
BaseManager.h
Go to the documentation of this file.
1#ifndef LS_BASE_MANAGER_H
2#define LS_BASE_MANAGER_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning( push )
7#pragma warning( disable : 4251 )
8#endif
9
10#include "Configuration.h"
11#include "ProductDetails.h"
12#include "UserLicensesData.h"
13#include "License.h"
14#include "LicenseStorage.h"
15
17{
18 class LicenseService;
19 class DataHandler;
20
25 {
26 public:
32 BaseManager( const BaseManager& ) = delete;
33 BaseManager& operator =( const BaseManager& ) = delete;
35 virtual ~BaseManager();
36
40
45
57 ProductDetails getProductDetails( bool includeLatestVersion = false );
58
64
70
75
79
86 const std::wstring& dataLocation() const;
87
93 void setDataLocation( const std::wstring& path );
94
98 std::wstring licenseFileName() const;
99
104 void setLicenseFileName( const std::wstring& name );
105
109 std::wstring licenseFilePath() const;
110
111 protected:
113 std::shared_ptr<DataHandler> m_dataHandler;
114 std::shared_ptr<LicenseService> m_pLicenseService;
116
118 void reset();
119 };
120}
121
122#ifdef _MSC_VER
123#pragma warning( pop )
124#endif
125
126#endif // LS_BASE_MANAGER_H
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition APIDef.h:22
Base class for license management.
Definition BaseManager.h:25
std::shared_ptr< DataHandler > m_dataHandler
void clearLocalStorage()
Remove local license, other files and folders created by LicenseSpring, usually should be called at a...
std::shared_ptr< LicenseService > m_pLicenseService
void reset()
Reset (delete) members.
void reconfigure(Configuration::ptr_t config)
Change current configuration.
const License::ptr_t getCurrentLicense()
Load license from local storage (if not yet loaded).
const std::wstring & dataLocation() const
Absolute folder path where LicenseSpring data is stored.
BaseManager(const BaseManager &)=delete
bool isLicenseFileCorrupted()
Checks if license file is damaged or corrupted.
std::wstring licenseFilePath() const
Return concatenated dataLocation() and licenseFileName().
std::wstring licenseFileName() const
Return license file name with extension, unless filename was explicitly set to be without extension.
Configuration::ptr_t currentConfig() const
Returns current configuration.
ProductDetails getProductDetails(bool includeLatestVersion=false)
Get basic information from the backend on product which corresponds to the current configuration.
License::ptr_t m_currentLicense
virtual ~BaseManager()
Destroy LicenseManger with current configuration.
Configuration::ptr_t m_config
const License::ptr_t reloadLicense()
Resets current license and loads it again from local storage.
void setLicenseFileName(const std::wstring &name)
Set license file name, it can be with or without extension.
BaseManager(Configuration::ptr_t config, LicenseStorage::ptr_t storage=nullptr)
Create and intialize license manager with given configuration.
void setDataLocation(const std::wstring &path)
Set absolute or relative path to folder where LicenseSpring data should be stored.
std::shared_ptr< Configuration > ptr_t
std::shared_ptr< License > ptr_t
Definition License.h:36
std::shared_ptr< LicenseStorage > ptr_t
Class that encapsulates information about a product.