LicenseSpring C++ SDK  7.31.0
Easily add Software Licensing to your application
Configuration.h
Go to the documentation of this file.
1 #ifndef LS_CONFIGURATION_H
2 #define LS_CONFIGURATION_H
3 
4 #ifdef _MSC_VER
5 #pragma once
6 #pragma warning( push )
7 #pragma warning( disable : 4251 )
8 #endif
9 
10 #include <memory>
11 #include "ExtendedOptions.h"
12 
13 namespace LicenseSpring
14 {
18  {
19  public:
20  using ptr_t = std::shared_ptr<Configuration>;
21 
23  Configuration() = default;
24 
35  static ptr_t Create( const std::string& apiKey,
36  const std::string& sharedKey,
37  const std::string& productCode,
38  const std::string& appName,
39  const std::string& appVersion,
40  const ExtendedOptions& extendedOptions = ExtendedOptions() );
41 
44  const std::string& getApiKey() const;
45 
48  const std::string& getSharedKey() const;
49 
52  const std::string& getProductCode() const;
53 
56  const std::string& getAppName() const;
57 
60  const std::string& getAppVersion() const;
61 
65  const std::string& getCustomerAccount() const;
66 
70  void setCustomerAccount( const std::string& accountCode );
71 
74  const std::string& getAirGapPublicKey() const;
75 
78  void setAirGapPublicKey( const std::string& key );
79 
83  const std::wstring& getLicenseFilePath() const;
84 
91  const std::string& getHardwareID();
92 
96  void setHardwareID( const std::string& deviceId );
97 
100  void setDeviceIdAlgorithm( DeviceIDAlgorithm algorithm );
101 
104  bool isCollectNetworkInfoEnabled() const;
105 
108  bool isLoggingEnabled() const;
109 
112  bool isGuardFileEnabled() const;
113 
117  bool isSSLCheckEnabled() const;
118 
122  bool isNativeTLSEnabled() const;
123 
126  uint32_t getGracePeriod() const;
127 
131  long getNetworkTimeout() const;
132 
135  void setNetworkTimeout( long timeoutValue );
136 
139  const ProxySettings& getProxySettings() const;
140 
143  uint32_t getLicenseSpringAPIVersion() const;
144 
147  const std::string& getSdkVersion() const;
148 
151  const std::string& getOsVersion() const;
152 
155  const std::string& getHostName() const; // note: string is UTF-8 encoded
156 
159  const std::string& getIP() const;
160 
163  const std::string& getMAC() const;
164 
167  const NetworkInfo& getNetworkInfo() const;
168 
171  bool isVMDetectionEnabled() const;
172 
177  bool isVM() const;
178 
183  const std::string& getDetectedVMName() const;
184 
187  CryptoProvider::ptr_t getCryptoProvider();
188 
191  const std::string& getAlternateServiceUrl() const;
192 
195  const std::string& getAlternateKey() const;
196 
200  const std::string& getUserInfo() const;
201 
204  void setUserInfo( const std::string& customInfo );
205 
206  private:
207  std::string m_apiKey;
208  std::string m_sharedKey;
209  std::string m_productCode;
210  std::string m_customerAccount;
211  std::string m_appName;
212  std::string m_appVersion;
213  std::string m_userInfo;
214  std::string m_airGapPublicKey;
215  ExtendedOptions m_extOptions;
216  };
217 }
218 
219 #ifdef _MSC_VER
220 #pragma warning( pop )
221 #endif
222 
223 #endif // LS_CONFIGURATION_H
LicenseSpring::Configuration::ptr_t
std::shared_ptr< Configuration > ptr_t
Definition: Configuration.h:20
LicenseSpring::CryptoProvider::ptr_t
std::shared_ptr< CryptoProvider > ptr_t
Definition: CryptoProvider.h:22
LicenseSpring
Definition: BaseManager.h:15
ExtendedOptions.h
DeviceIDAlgorithm
DeviceIDAlgorithm
Type of Device ID algorithm used by the SDK.
Definition: PODTypes.h:103
LicenseSpring::NetworkInfo
Class for storing a device's network information.
Definition: ExtendedOptions.h:19
LS_API
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition: APIDef.h:22
LicenseSpring::Configuration
Class for configuring application.
Definition: Configuration.h:17
LicenseSpring::ExtendedOptions
Class for storing useful settings that the Configuration object will inherit.
Definition: ExtendedOptions.h:110
LicenseSpring::ProxySettings
Class for storing settings when using a proxy server.
Definition: ExtendedOptions.h:59