GL Studio C++ Runtime API
license_util.h
Go to the documentation of this file.
1 /*! \file
2  \brief Utility functions for licensing.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 
41 #ifndef _LICENSE_UTIL_H
42 #define _LICENSE_UTIL_H
43 
44 #include <string>
45 
46 // FlexNet Embedded
47 #include "FlxPublisher.h"
48 #include "FlxTypes.h"
49 #include "gls_include.h"
50 
51 // FlexNet Embedded
52 /*----------------------------------------------------------------------*/
53 
54 /** Processes a FlexNet Embedded Error and returns the details of the error
55  * \param errString General error string used as fallback
56  * \param error FlexNet Embedded Error object to track errors
57  * \param logError Whether to log this error into the error log
58  * \param errorStatus FlexNet Embedded Error status object for errors with status
59  * \return the full error string with FlexNet Embedded Errors if found
60  */
61 std::string GetFlexNetEmbeddedErrorString( const char* errString, FlxErrorRef error, bool logError = true, FlxErrorStatusRef errorStatus = NULL );
62 
63 /** Logs a FlexNetEmbedded Error for tracking multiple errors
64  * \param error FlexNet Embedded Error object to track errors
65  */
66 void LogFlexNetEmbeddedError( FlxErrorRef error );
67 
68 /** Logs a generic FlexNetEmbedded Error that isn't associated
69  * directly with a FlexNetEmbedded function
70  * \param errorString The error string to log
71  */
72 void LogFlexNetEmbeddedErrorString( const std::string& errorString );
73 
74 std::string GetFlexNetEmbeddedErrorList();
75 void ClearFlexNetEmbeddedErrorList();
76 
77 /** Gets a space delimited string of all found
78  * mac address host IDs for the current machine
79  */
80 std::string GetMacAddressHostIds();
81 
82 /** Send a simple HTTP 1.1 request to a server and load the response
83  * Caller is responsible for deleting response buffer when finished.
84  * \param serverName Host name of the server to send request to
85  * \param serverPort Port of the server to send request to
86  * \param request Buffer request to send to the server
87  * \param requestSize Size of the buffer request to send to the server
88  * \param response Response buffer to allocate and load response into
89  * \param error FlexNet Embedded Error object to track errors
90  * \return size of response
91  */
92 FlxSize FlexNetEmbeddedHttpRequest( const char* serverName, int serverPort,
93  const unsigned char* request, size_t requestSize,
94  unsigned char** response, FlxErrorRef error );
95 
96 // FlexNet Publisher
97 /*----------------------------------------------------------------------*/
98 std::string Decrypt( std::string input, std::string key );
99 
100 #endif
FlxSize FlexNetEmbeddedHttpRequest(const char *serverName, int serverPort, const unsigned char *request, size_t requestSize, unsigned char **response, FlxErrorRef error)
A file for all GL Studio files to include.
std::string GetFlexNetEmbeddedErrorString(const char *errString, FlxErrorRef error, bool logError=true, FlxErrorStatusRef errorStatus=NULL)
std::string GetMacAddressHostIds()
void LogFlexNetEmbeddedErrorString(const std::string &errorString)
void LogFlexNetEmbeddedError(FlxErrorRef error)