PLicensing.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PLog.h>
17 #include <PObject.h>
18 #include <PString.h>
19 
20 PAPILLON_BEGIN_NAMESPACE
21 
22 class PStringList;
23 class PVersion;
24 
25 struct PAPILLON_API_CORE PLicense {
26  PLicense();
28 };
29 
38 class PAPILLON_API_CORE PLicensing : public PObject {
39  public:
43  static PLicensing& GetInstance();
44 
48  virtual ~PLicensing();
49 
53  PString Status() const;
54 
77  PResult Initialise(const PString& argv0, const PString& license, PLog::ELogLevel logLevel);
78 
86  void Reset();
87 
92  bool IsLicenseServerEnabled() const;
93 
97  PStringList GetListProducts() const;
98 
102  papillon::PStringList GetLicenseFilenames() const;
103 
114  PResult GetLicenseInfo(const PString& productName,
115  papillon::int32& total,
116  papillon::int32& used,
117  PString& expiration) const;
118 
130  PResult GetLicenseInfoExt(const PString& productName,
131  PVersion& version,
132  papillon::int32& total,
133  papillon::int32& used,
134  PString& expiration,
135  papillon::int32& expDays) const;
136 
151  PResult CheckOutLicense(const PString& productName, const PString& productVersion, PLicense& license);
152 
159  PResult CheckInLicense(PLicense& license);
160 
167  PResult CheckLicense(PLicense license);
168 
172  PString ToString();
173 
174  private:
180  PLicensing();
181 
182  private:
183  PLicensing(const PLicensing&);
184  PLicensing& operator=(const PLicensing&) const;
185 };
186 
187 PAPILLON_END_NAMESPACE
The PString class provides an Unicode character strings.
Definition: PString.h:37
The log system.
The PVersion class represents a software version number: major.minor[.maintenance[.build]]; immutable, so thread-safe.
Definition: PVersion.h:26
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
void * m_licenseHandle
Definition: PLicensing.h:27
ELogLevel
All the available log levels.
Definition: PLog.h:81
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
Class PString: an unicode character strings (use copy-on-write idiom).
PString ToString() const
Returns a string representation of this object.
The PStringList class represents a list of PString; NOT thread-safe.
Definition: PStringList.h:26
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45
The PLicensing class is the license manager (singleton) used to manage Papillon licenses for both Cor...
Definition: PLicensing.h:38