-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDynamsoftLicense.h
More file actions
96 lines (92 loc) · 3.13 KB
/
Copy pathDynamsoftLicense.h
File metadata and controls
96 lines (92 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma once
#define DYNAMSOFT_LICENSE_VERSION "4.6.30.8649"
#if !defined(_WIN32) && !defined(_WIN64)
#define LIC_API __attribute__((visibility("default")))
#include <stddef.h>
#else
#ifdef LIC_EXPORTS
#define LIC_API __declspec(dllexport)
#else
#define LIC_API
#endif
#include <windows.h>
#endif
#ifdef __cplusplus
namespace dynamsoft
{
namespace license
{
#pragma pack(push)
#pragma pack(4)
/**
* The CLicenseManager class provides a set of APIs to manage SDK licensing.
*
*/
class LIC_API CLicenseManager
{
public:
/**
* It is used to initialize the license using a license key.
*
* @param [in] pLicense The license key as a string.
* @param [in, out] errorMsgBuffer The buffer is allocated by caller and the recommended length is 256. The error message will be copied to the buffer. It can be set to NULL if error messages are not required.
* @param [in] errorMsgBufferLen The length of the error message buffer. It is ignored if errorMsgBuffer is set to NULL.
*
* @return Returns 0 if the license is initialized successfully, a negative value indicating an error otherwise.
*
*/
static int InitLicense(const char* pLicense, char errorMsgBuffer[] = NULL, const int errorMsgBufferLen = 0);
/**
* It is used to set the friendly name of the device.
*
* @param [in] name The friendly name of the device.
*
* @return Returns 0 if the friendly name is set successfully, a negative value indicating an error otherwise.
*
*/
static int SetDeviceFriendlyName(const char* name);
/**
* It is used to set the maximum number of allowed instances for the given device and process.
*
* @param [in] countForThisDevice The maximum number of allowed instances for the device.
*
* @return Returns error code (returns 0 if the function operates successfully).
*
*/
static int SetMaxConcurrentInstanceCount(int countForThisDevice);
/**
* It is used to get the unique identifier of the device.
*
* @param [in] uuidGenerationMethod The method to generate the UUID.
* @param [in, out] uuidBuffer The buffer to store the UUID.
* @param [in] uuidBufferLen The length of the UUID buffer. It is recommended to be greater than 36.
*
* @return Returns 0 if the UUID is generated successfully, a negative value indicating an error otherwise.
*
*/
static int GetDeviceUUID(int uuidGenerationMethod, char uuidBuffer[], const int uuidbufferLen);
/**
* It is used to set the directory path for the license cache.
*
* @param [in] directoryPath The directory path for the license cache.
*
* @return Returns 0 if the directory path is set successfully, a negative value indicating an error otherwise.
*
*/
static int SetLicenseCachePath(const char* directoryPath);
};
class LIC_API CLicenseModule
{
public:
/**
* It is used to get the version of the licensing library.
*
* @return Returns the version of the licensing library as a string.
*
*/
static const char* GetVersion();
};
#pragma pack(pop)
}
}
#endif