| LicenseSpring C++ SDK 7.27.0 Easily add Software Licensing to your application

InstallationFile.h
Go to the documentation of this file.
1 #ifndef LS_INSTALLATION_FILE_H
2 #define LS_INSTALLATION_FILE_H
3
4 #ifdef _MSC_VER
5 #pragma once
6 #pragma warning( push )
7 #pragma warning( disable : 4251 )
8 #endif
9
10 #include <string>
11 #include <memory>
12 #include "APIDef.h"
13
14 namespace LicenseSpring
15 {
18 struct LS_API InstallFileFilter
19 {
21 InstallFileFilter() = default;
22
26 InstallFileFilter( const char* channel, const char* env = nullptr )
27 {
28 if( channel != nullptr ) Channel = channel;
29 if( env != nullptr ) Environment = env;
30 }
31
35 InstallFileFilter( const std::string& channel, const std::string& env = std::string() )
36 : Channel( channel ), Environment( env ) {}
37
40 std::string Channel;
41
44 std::string Environment;
45 };
46
47
51 class LS_API InstallationFile
52 {
53 public:
54 using ptr_t = std::shared_ptr<InstallationFile>;
55
57 InstallationFile() : m_size( 0 ) {}
58
70 InstallationFile( const std::string& url, const std::string& version,
71 const std::string& requiredVersion, const std::string& md5hash,
72 const std::string& releaseDate, const std::string& environment,
73 const std::string& eulaLink, const std::string& releaseNotesLink,
74 const std::string& channel, uint64_t size )
75 : m_url( url ),
76 m_version( version ),
77 m_requiredVersion( requiredVersion ),
78 m_md5hash( md5hash ),
79 m_releaseDate( releaseDate ),
80 m_environment( environment ),
81 m_eulaLink( eulaLink ),
82 m_releaseNotesLink( releaseNotesLink ),
83 m_channel( channel ),
84 m_size( size )
85 {};
86
89 const std::string& url() const { return m_url; }
90
93 const std::string& version() const { return m_version; }
94
98 const std::string& requiredVersion() const { return m_requiredVersion; }
99
102 const std::string& md5Hash() const { return m_md5hash; }
103
106 const std::string& releaseDate() const { return m_releaseDate; }
107
110 const std::string& environment() const { return m_environment; }
111
114 const std::string& eulaLink() const { return m_eulaLink; }
115
118 const std::string& releaseNotesLink() const { return m_releaseNotesLink; }
119
122 const std::string& channel() const { return m_channel; }
123
126 uint64_t size() const { return m_size; }
127
128 private:
129 std::string m_url;
130 std::string m_version;
131 std::string m_requiredVersion;
132 std::string m_md5hash;
133 std::string m_releaseDate;
134 std::string m_environment;
135 std::string m_eulaLink;
136 std::string m_releaseNotesLink;
137 std::string m_channel;
138 uint64_t m_size;
139 };
140 }
141
142 #ifdef _MSC_VER
143 #pragma warning( pop )
144 #endif
145
146 #endif // LS_INSTALLATION_FILE_H
LicenseSpring::InstallFileFilter::Channel
std::string Channel
Channel from where installation file should be requested.
Definition: InstallationFile.h:40
LicenseSpring::InstallationFile
Class that represents information on product installation file.
Definition: InstallationFile.h:51
LicenseSpring
Definition: BaseManager.h:15
LicenseSpring::InstallationFile::md5Hash
const std::string & md5Hash() const
Getter method for setup file MD5 hash.
Definition: InstallationFile.h:102
LicenseSpring::InstallationFile::version
const std::string & version() const
Getter method for setup file version.
Definition: InstallationFile.h:93
APIDef.h
LicenseSpring::InstallationFile::releaseNotesLink
const std::string & releaseNotesLink() const
Getter method for setup file release notes link.
Definition: InstallationFile.h:118
LicenseSpring::InstallationFile::environment
const std::string & environment() const
Getter method for setup file environment.
Definition: InstallationFile.h:110
LicenseSpring::InstallationFile::InstallationFile
InstallationFile(const std::string &url, const std::string &version, const std::string &requiredVersion, const std::string &md5hash, const std::string &releaseDate, const std::string &environment, const std::string &eulaLink, const std::string &releaseNotesLink, const std::string &channel, uint64_t size)
Constructs InstallationFile with given data.
Definition: InstallationFile.h:70
LicenseSpring::InstallationFile::eulaLink
const std::string & eulaLink() const
Getter method for setup file End-User License Agreement link.
Definition: InstallationFile.h:114
LicenseSpring::InstallFileFilter::InstallFileFilter
InstallFileFilter(const std::string &channel, const std::string &env=std::string())
Constructs filter with given channel and environment.
Definition: InstallationFile.h:35
LicenseSpring::InstallationFile::releaseDate
const std::string & releaseDate() const
Getter method for setup file release date.
Definition: InstallationFile.h:106
LicenseSpring::InstallationFile::size
uint64_t size() const
Getter method for setup file size.
Definition: InstallationFile.h:126
LicenseSpring::InstallFileFilter::Environment
std::string Environment
Environment for which installation file should be requested.
Definition: InstallationFile.h:44
LicenseSpring::InstallationFile::url
const std::string & url() const
Getter method for setup file URL.
Definition: InstallationFile.h:89
LicenseSpring::InstallFileFilter::InstallFileFilter
InstallFileFilter(const char *channel, const char *env=nullptr)
Constructs filter with given channel and environment from c-strings.
Definition: InstallationFile.h:26
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::InstallationFile::InstallationFile
InstallationFile()
Default constructor, creates empty installation file.
Definition: InstallationFile.h:57
LicenseSpring::InstallationFile::requiredVersion
const std::string & requiredVersion() const
Getter method for setup file required version.
Definition: InstallationFile.h:98
LicenseSpring::InstallationFile::channel
const std::string & channel() const
Getter method for setup file channel.
Definition: InstallationFile.h:122
LicenseSpring::InstallationFile::ptr_t
std::shared_ptr< InstallationFile > ptr_t
Definition: InstallationFile.h:54
LicenseSpring::InstallFileFilter
Helper struct for filtering installation files by environment and channel.
Definition: InstallationFile.h:18