diff --git a/docs/html/_agreement_8h_source.html b/docs/html/_agreement_8h_source.html index cb9392a..3d244fb 100644 --- a/docs/html/_agreement_8h_source.html +++ b/docs/html/_agreement_8h_source.html @@ -71,10 +71,12 @@
Agreement.h
-
1 #pragma once
2 #ifndef AGREEMENT_SCREEN_H
3 #define AGREEMENT_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Agreement_Screen : public Screen {
10 public:
11  // Public (de)Constructors
13  Agreement_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void checkYes();
25  void goPrevious();
27  void goNext();
29  void goCancel();
30 
31 
32  // Public Attributes
33  HWND m_log = nullptr, m_checkYes = nullptr, m_btnPrev = nullptr, m_btnNext = nullptr, m_btnCancel = nullptr;
34  bool m_agrees = false;
35 };
36 
37 #endif // AGREEMENT_SCREEN_H
Definition: Agreement.h:9
+
1 #pragma once
2 #ifndef AGREEMENT_SCREEN_H
3 #define AGREEMENT_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Agreement_Screen : public Screen {
10 public:
11  // Public (de)Constructors
15  Agreement_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void checkYes();
27  void goPrevious();
29  void goNext();
31  void goCancel();
32 
33 
34  // Public Attributes
35  HWND m_log = nullptr, m_checkYes = nullptr, m_btnPrev = nullptr, m_btnNext = nullptr, m_btnCancel = nullptr;
36  bool m_agrees = false;
37 };
38 
39 #endif // AGREEMENT_SCREEN_H
Definition: Agreement.h:9
void goCancel()
Definition: Agreement.cpp:109
Definition: Screen.h:15
Definition: Screen.h:18
+
Agreement_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Agreement.cpp:17
+
~Agreement_Screen()
Definition: Agreement.cpp:7
void goPrevious()
Definition: Agreement.cpp:99
virtual void paint() override
Definition: Agreement.cpp:63
Definition: Installer.h:14
diff --git a/docs/html/_buffer_8h_source.html b/docs/html/_buffer_8h_source.html index 8be49bc..e648aab 100644 --- a/docs/html/_buffer_8h_source.html +++ b/docs/html/_buffer_8h_source.html @@ -71,8 +71,8 @@
Buffer.h
-
1 #pragma once
2 #ifndef BUFFER_H
3 #define BUFFER_H
4 
5 #include <optional>
6 
7 
8 namespace NST {
11  class Buffer {
12  public:
13  struct Header;
14  struct CompressionHeader;
15  struct DiffHeader;
16 
17 
18  // Public (de)Constructors
20  ~Buffer();
22  Buffer() = default;
25  Buffer(const size_t & size);
31  Buffer(std::byte * pointer, const size_t & range, bool hardCopy = true);
37  inline Buffer(void * pointer, const size_t & range, bool hardCopy = true)
38  : Buffer(reinterpret_cast<std::byte*>(pointer), range, hardCopy) { }
41  Buffer(const Buffer & other);
44  Buffer(Buffer && other);
45 
46 
47 
48 
49 
50  // Public Operators
54  Buffer & operator=(const Buffer & other);
58  Buffer & operator=(Buffer && other);
59 
60 
61  // Public Methods
64  const bool hasData() const;
67  const size_t & size() const;
70  const size_t hash() const;
77  void resize(const size_t & size);
80  void release();
81 
82 
83  // Public Mutable Data Accessors
87  char * cArray() const;
91  std::byte * data() const;
95  std::byte & operator[](const size_t & byteOffset) const;
101  size_t readData(void * outputPtr, const size_t & size, const size_t byteOffset = 0) const;
107  size_t writeData(const void * inputPtr, const size_t & size, const size_t byteOffset = 0);
108 
109 
110  // Public Manipulation Methods
117  std::optional<Buffer> compress() const;
120  std::optional<Buffer> decompress() const;
128  std::optional<Buffer> diff(const Buffer & target) const;
132  std::optional<Buffer> patch(const Buffer & diffBuffer) const;
133 
134 
135  // Public Header Methods
140  void readHeader(Header * header, std::byte ** dataPtr, size_t & dataSize) const;
144  void writeHeader(const Header * header);
145 
146 
147  // Public Header Structs
149  struct Header {
150  // Attributes
151  static constexpr const size_t TITLE_SIZE = 16ull;
152  char m_title[TITLE_SIZE] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };
153 
154 
155  // (de)Constructors
156  ~Header() = default;
157  Header() = default;
159  inline Header(const char * title) {
160  strcpy_s(&m_title[0], TITLE_SIZE, title);
161  }
162 
163 
164  // Interface
167  virtual bool isValid() const = 0;
170  virtual size_t size() const = 0;
174  inline virtual std::byte * operator << (std::byte * ptr) {
175  std::copy(ptr, ptr + TITLE_SIZE, reinterpret_cast<std::byte*>(&m_title[0]));
176  return &ptr[TITLE_SIZE];
177  }
181  inline virtual std::byte * operator >> (std::byte * ptr) const {
182  std::copy(m_title, m_title + TITLE_SIZE, reinterpret_cast<char*>(ptr));
183  return &ptr[TITLE_SIZE];
184  }
185  };
188  // Attributes
189  size_t m_uncompressedSize = 0ull;
190 
191 
192  // (de)Constructors
193  inline CompressionHeader(const size_t size = 0ull) : Header("nSuite cmpress"), m_uncompressedSize(size) {}
194 
195 
196  // Interface Implementation
197  inline virtual bool isValid() const override {
198  return (std::strcmp(m_title, "nSuite cmpress") == 0);
199  }
200  inline virtual size_t size() const override {
201  return size_t(sizeof(size_t));
202  }
203  inline virtual std::byte * operator << (std::byte * ptr) override {
204  ptr = Header::operator<<(ptr);
205  std::copy(ptr, &ptr[size()], reinterpret_cast<std::byte*>(&m_uncompressedSize));
206  return &ptr[size()];
207  }
208  inline virtual std::byte *operator >> (std::byte * ptr) const override {
209  ptr = Header::operator>>(ptr);
210  *reinterpret_cast<size_t*>(ptr) = m_uncompressedSize;
211  return &ptr[size()];
212  }
213  };
215  struct DiffHeader : Header {
216  // Attributes
217  size_t m_targetSize = 0ull;
218 
219 
220  // (de)Constructors
221  inline DiffHeader(const size_t size = 0ull) : Header("nSuite differ"), m_targetSize(size) {}
222 
223 
224  // Interface Implementation
225  inline virtual bool isValid() const override {
226  return (std::strcmp(m_title, "nSuite differ") == 0);
227  }
228  inline virtual size_t size() const override {
229  return size_t(sizeof(size_t));
230  }
231  inline virtual std::byte * operator << (std::byte * ptr) override {
232  ptr = Header::operator>>(ptr);
233  std::copy(ptr, &ptr[size()], reinterpret_cast<std::byte*>(&m_targetSize));
234  return &ptr[size()];
235  }
236  inline virtual std::byte *operator >> (std::byte * ptr) const override {
237  ptr = Header::operator>>(ptr);
238  *reinterpret_cast<size_t*>(ptr) = m_targetSize;
239  return &ptr[size()];
240  }
241  };
242 
243 
244  // Public Diff-Instruction Structure
247  // Constructor
248  inline Differential_Instruction(const char & t) : m_type(t) {}
249 
250 
251  // Interface Declaration
253  virtual size_t size() const = 0;
255  virtual void execute(NST::Buffer & bufferNew, const NST::Buffer & bufferOld) const = 0;
257  virtual void write(NST::Buffer & outputBuffer, size_t & byteIndex) const = 0;
259  virtual void read(const NST::Buffer & inputBuffer, size_t & byteIndex) = 0;
260 
261 
262  // Attributes
263  const char m_type = 0;
264  size_t m_index = 0ull;
265  };
266 
267 
268  private:
269  // Private Methods
272  void alloc(const size_t & capacity);
273 
274 
275  // Private Attributes
276  std::byte * m_data = nullptr;
277  size_t m_size = 0ull, m_capacity = 0ull;
278  bool m_ownsData = false;
279  };
280 };
281 
282 #endif // BUFFER_H
size_t writeData(const void *inputPtr, const size_t &size, const size_t byteOffset=0)
Definition: Buffer.cpp:189
-
virtual size_t size() const override
Definition: Buffer.h:200
+
1 #pragma once
2 #ifndef BUFFER_H
3 #define BUFFER_H
4 
5 #include <optional>
6 
7 
8 namespace NST {
11  class Buffer {
12  public:
13  struct Header;
14  struct CompressionHeader;
15  struct DiffHeader;
16 
17 
18  // Public (de)Constructors
20  ~Buffer();
22  Buffer() = default;
25  Buffer(const size_t & size);
31  Buffer(std::byte * pointer, const size_t & range, bool hardCopy = true);
37  inline Buffer(void * pointer, const size_t & range, bool hardCopy = true)
38  : Buffer(reinterpret_cast<std::byte*>(pointer), range, hardCopy) { }
41  Buffer(const Buffer & other);
44  Buffer(Buffer && other);
45 
46 
47 
48 
49 
50  // Public Operators
54  Buffer & operator=(const Buffer & other);
58  Buffer & operator=(Buffer && other);
59 
60 
61  // Public Methods
64  const bool hasData() const;
67  const size_t & size() const;
70  const size_t hash() const;
77  void resize(const size_t & size);
80  void release();
81 
82 
83  // Public Mutable Data Accessors
87  char * cArray() const;
91  std::byte * data() const;
95  std::byte & operator[](const size_t & byteOffset) const;
101  size_t readData(void * outputPtr, const size_t & size, const size_t byteOffset = 0) const;
107  size_t writeData(const void * inputPtr, const size_t & size, const size_t byteOffset = 0);
108 
109 
110  // Public Manipulation Methods
117  std::optional<Buffer> compress() const;
120  std::optional<Buffer> decompress() const;
128  std::optional<Buffer> diff(const Buffer & target) const;
132  std::optional<Buffer> patch(const Buffer & diffBuffer) const;
133 
134 
135  // Public Header Methods
140  void readHeader(Header * header, std::byte ** dataPtr, size_t & dataSize) const;
144  void writeHeader(const Header * header);
145 
146 
147  // Public Header Structs
149  struct Header {
150  // Attributes
151  static constexpr const size_t TITLE_SIZE = 16ull;
152  char m_title[TITLE_SIZE] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 };
153 
154 
155  // (de)Constructors
156  ~Header() = default;
157  Header() = default;
159  inline Header(const char * title) {
160  strcpy_s(&m_title[0], TITLE_SIZE, title);
161  }
162 
163 
164  // Interface
167  virtual bool isValid() const = 0;
170  virtual size_t size() const = 0;
174  inline virtual std::byte * operator << (std::byte * ptr) {
175  std::copy(ptr, ptr + TITLE_SIZE, reinterpret_cast<std::byte*>(&m_title[0]));
176  return &ptr[TITLE_SIZE];
177  }
181  inline virtual std::byte * operator >> (std::byte * ptr) const {
182  std::copy(m_title, m_title + TITLE_SIZE, reinterpret_cast<char*>(ptr));
183  return &ptr[TITLE_SIZE];
184  }
185  };
188  // Attributes
189  size_t m_uncompressedSize = 0ull;
190 
191 
192  // (de)Constructors
195  inline CompressionHeader(const size_t size = 0ull) : Header("nSuite cmpress"), m_uncompressedSize(size) {}
196 
197 
198  // Interface Implementation
199  inline virtual bool isValid() const override {
200  return (std::strcmp(m_title, "nSuite cmpress") == 0);
201  }
202  inline virtual size_t size() const override {
203  return size_t(sizeof(size_t));
204  }
205  inline virtual std::byte * operator << (std::byte * ptr) override {
206  ptr = Header::operator<<(ptr);
207  std::copy(ptr, &ptr[size()], reinterpret_cast<std::byte*>(&m_uncompressedSize));
208  return &ptr[size()];
209  }
210  inline virtual std::byte *operator >> (std::byte * ptr) const override {
211  ptr = Header::operator>>(ptr);
212  *reinterpret_cast<size_t*>(ptr) = m_uncompressedSize;
213  return &ptr[size()];
214  }
215  };
217  struct DiffHeader : Header {
218  // Attributes
219  size_t m_targetSize = 0ull;
220 
221 
222  // (de)Constructors
225  inline DiffHeader(const size_t size = 0ull) : Header("nSuite differ"), m_targetSize(size) {}
226 
227 
228  // Interface Implementation
229  inline virtual bool isValid() const override {
230  return (std::strcmp(m_title, "nSuite differ") == 0);
231  }
232  inline virtual size_t size() const override {
233  return size_t(sizeof(size_t));
234  }
235  inline virtual std::byte * operator << (std::byte * ptr) override {
236  ptr = Header::operator>>(ptr);
237  std::copy(ptr, &ptr[size()], reinterpret_cast<std::byte*>(&m_targetSize));
238  return &ptr[size()];
239  }
240  inline virtual std::byte *operator >> (std::byte * ptr) const override {
241  ptr = Header::operator>>(ptr);
242  *reinterpret_cast<size_t*>(ptr) = m_targetSize;
243  return &ptr[size()];
244  }
245  };
246 
247 
248  // Public Diff-Instruction Structure
251  // Constructor
254  inline Differential_Instruction(const char & t) : m_type(t) {}
255 
256 
257  // Interface Declaration
259  virtual size_t size() const = 0;
261  virtual void execute(NST::Buffer & bufferNew, const NST::Buffer & bufferOld) const = 0;
263  virtual void write(NST::Buffer & outputBuffer, size_t & byteIndex) const = 0;
265  virtual void read(const NST::Buffer & inputBuffer, size_t & byteIndex) = 0;
266 
267 
268  // Attributes
269  const char m_type = 0;
270  size_t m_index = 0ull;
271  };
272 
273 
274  private:
275  // Private Methods
278  void alloc(const size_t & capacity);
279 
280 
281  // Private Attributes
282  std::byte * m_data = nullptr;
283  size_t m_size = 0ull, m_capacity = 0ull;
284  bool m_ownsData = false;
285  };
286 };
287 
288 #endif // BUFFER_H
size_t writeData(const void *inputPtr, const size_t &size, const size_t byteOffset=0)
Definition: Buffer.cpp:189
+
virtual size_t size() const override
Definition: Buffer.h:202
const size_t hash() const
Definition: Buffer.cpp:110
Buffer & operator=(const Buffer &other)
Definition: Buffer.cpp:59
size_t readData(void *outputPtr, const size_t &size, const size_t byteOffset=0) const
Definition: Buffer.cpp:182
@@ -82,33 +82,36 @@
const bool hasData() const
Definition: Buffer.cpp:100
char * cArray() const
Definition: Buffer.cpp:167
std::byte & operator[](const size_t &byteOffset) const
Definition: Buffer.cpp:177
-
Definition: Buffer.h:215
-
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Buffer.h:231
- +
Definition: Buffer.h:217
+
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Buffer.h:235
+
void release()
Definition: Buffer.cpp:154
virtual void execute(NST::Buffer &bufferNew, const NST::Buffer &bufferOld) const =0
-
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Buffer.h:236
+
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Buffer.h:240
void readHeader(Header *header, std::byte **dataPtr, size_t &dataSize) const
Definition: Buffer.cpp:614
std::optional< Buffer > compress() const
Definition: Buffer.cpp:200
std::optional< Buffer > decompress() const
Definition: Buffer.cpp:235
-
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Buffer.h:203
+
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Buffer.h:205
Definition: Buffer.h:149
Buffer()=default
-
virtual bool isValid() const override
Definition: Buffer.h:197
+
virtual bool isValid() const override
Definition: Buffer.h:199
std::optional< Buffer > patch(const Buffer &diffBuffer) const
Definition: Buffer.cpp:553
virtual bool isValid() const =0
-
virtual bool isValid() const override
Definition: Buffer.h:225
+
virtual bool isValid() const override
Definition: Buffer.h:229
virtual std::byte * operator<<(std::byte *ptr)
Definition: Buffer.h:174
virtual void read(const NST::Buffer &inputBuffer, size_t &byteIndex)=0
Definition: Buffer.h:187
+
CompressionHeader(const size_t size=0ull)
Definition: Buffer.h:195
Definition: Buffer.h:8
std::optional< Buffer > diff(const Buffer &target) const
Definition: Buffer.cpp:318
-
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Buffer.h:208
-
virtual size_t size() const override
Definition: Buffer.h:228
+
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Buffer.h:210
+
virtual size_t size() const override
Definition: Buffer.h:232
void resize(const size_t &size)
Definition: Buffer.cpp:129
virtual std::byte * operator >>(std::byte *ptr) const
Definition: Buffer.h:181
+
DiffHeader(const size_t size=0ull)
Definition: Buffer.h:225
Header(const char *title)
Definition: Buffer.h:159
virtual size_t size() const =0
+
Differential_Instruction(const char &t)
Definition: Buffer.h:254
void writeHeader(const Header *header)
Definition: Buffer.cpp:623
virtual void write(NST::Buffer &outputBuffer, size_t &byteIndex) const =0
const size_t & size() const
Definition: Buffer.cpp:105
diff --git a/docs/html/_install_8h_source.html b/docs/html/_install_8h_source.html index 65be09b..c0e900f 100644 --- a/docs/html/_install_8h_source.html +++ b/docs/html/_install_8h_source.html @@ -71,13 +71,15 @@
Install.h
-
1 #pragma once
2 #ifndef INSTALL_SCREEN_H
3 #define INSTALL_SCREEN_H
4 
5 #include "Screen.h"
6 #include <string>
7 
8 
10 class Install_Screen : public Screen {
11 public:
12  // Public (de)Constructors
13  ~Install_Screen();
14  Install_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
15 
16 
17  // Public Interface Implementations
18  virtual void enact() override;
19  virtual void paint() override;
20 
21 
22  // Public Methods
24  void goFinish();
25 
26 
27  // Public Attributes
28  HWND m_hwndLog = nullptr, m_hwndPrgsBar = nullptr, m_btnFinish = nullptr;
29  size_t m_logIndex = 0ull, m_taskIndex = 0ull;
30 };
31 
32 #endif // INSTALL_SCREEN_H
virtual void paint() override
Definition: Install.cpp:72
+
1 #pragma once
2 #ifndef INSTALL_SCREEN_H
3 #define INSTALL_SCREEN_H
4 
5 #include "Screen.h"
6 #include <string>
7 
8 
10 class Install_Screen : public Screen {
11 public:
12  // Public (de)Constructors
16  Install_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
17 
18 
19  // Public Interface Implementations
20  virtual void enact() override;
21  virtual void paint() override;
22 
23 
24  // Public Methods
26  void goFinish();
27 
28 
29  // Public Attributes
30  HWND m_hwndLog = nullptr, m_hwndPrgsBar = nullptr, m_btnFinish = nullptr;
31  size_t m_logIndex = 0ull, m_taskIndex = 0ull;
32 };
33 
34 #endif // INSTALL_SCREEN_H
virtual void paint() override
Definition: Install.cpp:72
Definition: Screen.h:15
Definition: Screen.h:18
+
~Install_Screen()
Definition: Install.cpp:11
void goFinish()
Definition: Install.cpp:98
virtual void enact() override
Definition: Install.cpp:67
Definition: Install.h:10
Definition: Installer.h:14
+
Install_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Install.cpp:22
-
1 #pragma once
2 #ifndef DIRECTORY_SCREEN_H
3 #define DIRECTORY_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Directory_Screen : public Screen {
10 public:
11  // Public (de)Constructors
13  Directory_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void browse();
25  void goPrevious();
27  void goInstall();
29  void goCancel();
30 
31 
32  // Public Attributes
33  HWND m_directoryField = nullptr, m_packageField = nullptr, m_browseButton = nullptr, m_btnPrev = nullptr, m_btnInst = nullptr, m_btnCancel = nullptr;
34 };
35 
36 #endif // DIRECTORY_SCREEN_H
virtual void paint() override
Definition: Directory.cpp:65
+
1 #pragma once
2 #ifndef DIRECTORY_SCREEN_H
3 #define DIRECTORY_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Directory_Screen : public Screen {
10 public:
11  // Public (de)Constructors
15  Directory_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void browse();
27  void goPrevious();
29  void goInstall();
31  void goCancel();
32 
33 
34  // Public Attributes
35  HWND m_directoryField = nullptr, m_packageField = nullptr, m_browseButton = nullptr, m_btnPrev = nullptr, m_btnInst = nullptr, m_btnCancel = nullptr;
36 };
37 
38 #endif // DIRECTORY_SCREEN_H
virtual void paint() override
Definition: Directory.cpp:65
Definition: Screen.h:15
Definition: Screen.h:18
void browse()
Definition: Directory.cpp:115
void goPrevious()
Definition: Directory.cpp:128
+
Directory_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Directory.cpp:26
virtual void enact() override
Definition: Directory.cpp:60
void goInstall()
Definition: Directory.cpp:133
+
~Directory_Screen()
Definition: Directory.cpp:14
Definition: Installer.h:14
Definition: Directory.h:9
void goCancel()
Definition: Directory.cpp:147
diff --git a/docs/html/_installer_2include_2_screens_2_fail_8h_source.html b/docs/html/_installer_2include_2_screens_2_fail_8h_source.html index a7ea085..c357e6e 100644 --- a/docs/html/_installer_2include_2_screens_2_fail_8h_source.html +++ b/docs/html/_installer_2include_2_screens_2_fail_8h_source.html @@ -71,12 +71,14 @@
Fail.h
-
1 #pragma once
2 #ifndef FAIL_SCREEN_H
3 #define FAIL_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Fail_Screen: public Screen {
10 public:
11  // Public (de)Constructors
12  ~Fail_Screen();
13  Fail_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void goClose();
24 
25 
26  // Public Attributes
27  HWND m_hwndLog = nullptr, m_btnClose = nullptr;
28  size_t m_logIndex = 0ull;
29 };
30 
31 #endif // FAIL_SCREEN_H
Definition: Screen.h:15
+
1 #pragma once
2 #ifndef FAIL_SCREEN_H
3 #define FAIL_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Fail_Screen: public Screen {
10 public:
11  // Public (de)Constructors
13  ~Fail_Screen();
15  Fail_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void goClose();
26 
27 
28  // Public Attributes
29  HWND m_hwndLog = nullptr, m_btnClose = nullptr;
30  size_t m_logIndex = 0ull;
31 };
32 
33 #endif // FAIL_SCREEN_H
Definition: Screen.h:15
Definition: Screen.h:18
virtual void enact() override
Definition: Fail.cpp:53
void goClose()
Definition: Fail.cpp:85
+
Fail_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Fail.cpp:19
virtual void paint() override
Definition: Fail.cpp:58
Definition: Installer.h:14
+
~Fail_Screen()
Definition: Fail.cpp:10
Definition: Fail.h:9
diff --git a/docs/html/_installer_2include_2_screens_2_finish_8h_source.html b/docs/html/_installer_2include_2_screens_2_finish_8h_source.html index 882ffa4..78b95ea 100644 --- a/docs/html/_installer_2include_2_screens_2_finish_8h_source.html +++ b/docs/html/_installer_2include_2_screens_2_finish_8h_source.html @@ -71,13 +71,15 @@
Finish.h
-
1 #pragma once
2 #ifndef FINISH_SCREEN_H
3 #define FINISH_SCREEN_H
4 
5 #include "Screen.h"
6 #include <string>
7 #include <vector>
8 
9 
11 class Finish_Screen: public Screen {
12 public:
13  // Public (de)Constructors
14  ~Finish_Screen();
15  Finish_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void goClose();
30  void createShortcut(const std::string & srcPath, const std::string & wrkPath, const std::string & dstPath);
31 
32 
33  // Public Attributes
34  HWND m_checkbox = nullptr, m_btnClose = nullptr;
35  bool m_showDirectory = true;
36  std::vector<HWND> m_shortcutCheckboxes;
37  std::vector<std::wstring> m_shortcuts_d, m_shortcuts_s;
38 };
39 
40 #endif // FINISH_SCREEN_H
Definition: Screen.h:15
+
1 #pragma once
2 #ifndef FINISH_SCREEN_H
3 #define FINISH_SCREEN_H
4 
5 #include "Screen.h"
6 #include <string>
7 #include <vector>
8 
9 
11 class Finish_Screen: public Screen {
12 public:
13  // Public (de)Constructors
17  Finish_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
18 
19 
20  // Public Interface Implementations
21  virtual void enact() override;
22  virtual void paint() override;
23 
24 
25  // Public Methods
27  void goClose();
32  void createShortcut(const std::string & srcPath, const std::string & wrkPath, const std::string & dstPath);
33 
34 
35  // Public Attributes
36  HWND m_checkbox = nullptr, m_btnClose = nullptr;
37  bool m_showDirectory = true;
38  std::vector<HWND> m_shortcutCheckboxes;
39  std::vector<std::wstring> m_shortcuts_d, m_shortcuts_s;
40 };
41 
42 #endif // FINISH_SCREEN_H
Finish_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Finish.cpp:20
+
Definition: Screen.h:15
Definition: Screen.h:18
Definition: Finish.h:11
void goClose()
Definition: Finish.cpp:136
virtual void paint() override
Definition: Finish.cpp:110
void createShortcut(const std::string &srcPath, const std::string &wrkPath, const std::string &dstPath)
Definition: Finish.cpp:175
Definition: Installer.h:14
+
~Finish_Screen()
Definition: Finish.cpp:10
virtual void enact() override
Definition: Finish.cpp:105
diff --git a/docs/html/_installer_2include_2_screens_2_screen_8h_source.html b/docs/html/_installer_2include_2_screens_2_screen_8h_source.html index 72b4549..08b3a4e 100644 --- a/docs/html/_installer_2include_2_screens_2_screen_8h_source.html +++ b/docs/html/_installer_2include_2_screens_2_screen_8h_source.html @@ -71,10 +71,11 @@
Screen.h
-
1 #pragma once
2 #ifndef SCREEN_H
3 #define SCREEN_H
4 
5 #include <windows.h>
6 #pragma warning(push)
7 #pragma warning(disable:4458)
8 #include <gdiplus.h>
9 #pragma warning(pop)
10 
11 
12 using namespace Gdiplus;
13 class Installer;
15 struct vec2 { int x = 0, y = 0; };
16 
18 class Screen {
19 public:
20  // Public (de)Constructors
21  Screen(Installer * installer, const vec2 & pos, const vec2 & size) : m_installer(installer), m_pos(pos), m_size(size) {}
22 
23 
24  // Public Methods
27  void setVisible(const bool & state) {
28  ShowWindow(m_hwnd, state);
29  EnableWindow(m_hwnd, state);
30  }
31 
32 
33  // Public Interface Declarations
35  virtual void enact() = 0;
37  virtual void paint() = 0;
38 
39 
40  // Public Attributes
41  Installer * m_installer = nullptr;
42  HWND m_hwnd = nullptr;
43 
44 
45 protected:
46  // Private Attributes
47  WNDCLASSEX m_wcex;
48  HINSTANCE m_hinstance;
49  vec2 m_pos, m_size;
50 };
51 
52 #endif // SCREEN_H
void setVisible(const bool &state)
Definition: Screen.h:27
+
1 #pragma once
2 #ifndef SCREEN_H
3 #define SCREEN_H
4 
5 #include <windows.h>
6 #pragma warning(push)
7 #pragma warning(disable:4458)
8 #include <gdiplus.h>
9 #pragma warning(pop)
10 
11 
12 using namespace Gdiplus;
13 class Installer;
15 struct vec2 { int x = 0, y = 0; };
16 
18 class Screen {
19 public:
20  // Public (de)Constructors
22  ~Screen() = default;
24  Screen(Installer * installer, const vec2 & pos, const vec2 & size) : m_installer(installer), m_pos(pos), m_size(size) {}
25 
26 
27  // Public Methods
30  void setVisible(const bool & state) {
31  ShowWindow(m_hwnd, state);
32  EnableWindow(m_hwnd, state);
33  }
34 
35 
36  // Public Interface Declarations
38  virtual void enact() = 0;
40  virtual void paint() = 0;
41 
42 
43  // Public Attributes
44  Installer * m_installer = nullptr;
45  HWND m_hwnd = nullptr;
46 
47 
48 protected:
49  // Private Attributes
50  WNDCLASSEX m_wcex;
51  HINSTANCE m_hinstance;
52  vec2 m_pos, m_size;
53 };
54 
55 #endif // SCREEN_H
void setVisible(const bool &state)
Definition: Screen.h:30
Definition: Screen.h:15
Definition: Screen.h:18
Definition: Installer.h:14
+
Screen(Installer *installer, const vec2 &pos, const vec2 &size)
Definition: Screen.h:24
-
1 #pragma once
2 #ifndef WELCOME_SCREEN_H
3 #define WELCOME_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Welcome_Screen : public Screen {
10 public:
11  // Public (de)Constructors
12  ~Welcome_Screen();
13  Welcome_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void goNext();
25  void goCancel();
26 
27 
28  // Public Attributes
29  HWND m_btnNext = nullptr, m_btnCancel = nullptr;
30 };
31 
32 #endif // WELCOME_SCREEN_H
Definition: Screen.h:15
+
1 #pragma once
2 #ifndef WELCOME_SCREEN_H
3 #define WELCOME_SCREEN_H
4 
5 #include "Screen.h"
6 
7 
9 class Welcome_Screen : public Screen {
10 public:
11  // Public (de)Constructors
15  Welcome_Screen(Installer * installer, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void goNext();
27  void goCancel();
28 
29 
30  // Public Attributes
31  HWND m_btnNext = nullptr, m_btnCancel = nullptr;
32 };
33 
34 #endif // WELCOME_SCREEN_H
Welcome_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Welcome.cpp:15
+
Definition: Screen.h:15
Definition: Screen.h:18
void goCancel()
Definition: Welcome.cpp:93
virtual void enact() override
Definition: Welcome.cpp:43
+
~Welcome_Screen()
Definition: Welcome.cpp:7
Definition: Welcome.h:9
Definition: Installer.h:14
void goNext()
Definition: Welcome.cpp:88
diff --git a/docs/html/_installer_8h_source.html b/docs/html/_installer_8h_source.html index ea742dc..53ecc55 100644 --- a/docs/html/_installer_8h_source.html +++ b/docs/html/_installer_8h_source.html @@ -71,8 +71,10 @@
Installer.h
-
1 #pragma once
2 #ifndef INSTALLER_H
3 #define INSTALLER_H
4 
5 #include "Resource.h"
6 #include "Threader.h"
7 #include <map>
8 #include <string>
9 
10 
11 class Screen;
12 
14 class Installer {
15 public:
16  // Public (de)Constructors
17  ~Installer() = default;
18  Installer(const HINSTANCE hInstance);
19 
20 
21  // Public Enumerations
22  const enum ScreenEnums {
23  WELCOME_SCREEN, AGREEMENT_SCREEN, DIRECTORY_SCREEN, INSTALL_SCREEN, FINISH_SCREEN, FAIL_SCREEN,
24  SCREEN_COUNT
25  };
26 
27 
28  // Public Methods
30  void invalidate();
33  void setScreen(const ScreenEnums & screenIndex);
36  std::string getDirectory() const;
39  void setDirectory(const std::string & directory);
42  size_t getDirectorySizeCapacity() const;
45  size_t getDirectorySizeAvailable() const;
48  size_t getDirectorySizeRequired() const;
51  std::string getPackageName() const;
53  void beginInstallation();
55  static void dumpErrorLog();
57  void paint();
58 
59 
60  // Public manifest strings
62  struct compare_string {
63  bool operator()(const wchar_t * a, const wchar_t * b) const {
64  return wcscmp(a, b) < 0;
65  }
66  };
67  std::map<const wchar_t*, std::wstring, compare_string> m_mfStrings;
68 
69 
70 private:
71  // Private Constructors
72  Installer();
73 
74 
75  // Private Attributes
76  NST::Threader m_threader;
77  NST::Resource m_archive, m_manifest;
78  std::string m_directory = "", m_packageName = "";
79  bool m_valid = true;
80  size_t m_maxSize = 0ull, m_capacity = 0ull, m_available = 0ull;
81  ScreenEnums m_currentIndex = WELCOME_SCREEN;
82  Screen * m_screens[SCREEN_COUNT];
83  HWND m_hwnd = nullptr;
84 };
85 
86 #endif // INSTALLER_H
void beginInstallation()
Definition: Installer.cpp:215
+
1 #pragma once
2 #ifndef INSTALLER_H
3 #define INSTALLER_H
4 
5 #include "Resource.h"
6 #include "Threader.h"
7 #include <map>
8 #include <string>
9 
10 
11 class Screen;
12 
14 class Installer {
15 public:
16  // Public (de)Constructors
18  ~Installer() = default;
20  Installer(const HINSTANCE hInstance);
21 
22 
23  // Public Enumerations
25  const enum ScreenEnums {
26  WELCOME_SCREEN, AGREEMENT_SCREEN, DIRECTORY_SCREEN, INSTALL_SCREEN, FINISH_SCREEN, FAIL_SCREEN,
27  SCREEN_COUNT
28  };
29 
30 
31  // Public Methods
33  void invalidate();
36  void setScreen(const ScreenEnums & screenIndex);
39  std::string getDirectory() const;
42  void setDirectory(const std::string & directory);
45  size_t getDirectorySizeCapacity() const;
48  size_t getDirectorySizeAvailable() const;
51  size_t getDirectorySizeRequired() const;
54  std::string getPackageName() const;
56  void beginInstallation();
58  static void dumpErrorLog();
60  void paint();
61 
62 
63  // Public manifest strings
65  struct compare_string {
67  bool operator()(const wchar_t * a, const wchar_t * b) const {
68  return std::wcscmp(a, b) < 0;
69  }
70  };
71  std::map<const wchar_t*, std::wstring, compare_string> m_mfStrings;
72 
73 
74 private:
75  // Private Constructors
76  Installer();
77 
78 
79  // Private Attributes
80  NST::Threader m_threader;
81  NST::Resource m_archive, m_manifest;
82  std::string m_directory = "", m_packageName = "";
83  bool m_valid = true;
84  size_t m_maxSize = 0ull, m_capacity = 0ull, m_available = 0ull;
85  ScreenEnums m_currentIndex = WELCOME_SCREEN;
86  Screen * m_screens[SCREEN_COUNT];
87  HWND m_hwnd = nullptr;
88 };
89 
90 #endif // INSTALLER_H
bool operator()(const wchar_t *a, const wchar_t *b) const
Definition: Installer.h:67
+
void beginInstallation()
Definition: Installer.cpp:215
Definition: Screen.h:18
+
~Installer()=default
void setDirectory(const std::string &directory)
Definition: Installer.cpp:181
size_t getDirectorySizeRequired() const
Definition: Installer.cpp:205
Definition: Resource.h:31
@@ -84,9 +86,10 @@
Definition: Threader.h:14
Definition: Installer.h:14
void setScreen(const ScreenEnums &screenIndex)
Definition: Installer.cpp:164
-
Definition: Installer.h:62
+
Definition: Installer.h:65
size_t getDirectorySizeCapacity() const
Definition: Installer.cpp:195
static void dumpErrorLog()
Definition: Installer.cpp:286
+
ScreenEnums
Definition: Installer.h:25
-
1 #pragma once
2 #ifndef DIRECTORY_H
3 #define DIRECTORY_H
4 
5 #include "Buffer.h"
6 #include <string>
7 #include <vector>
8 
9 
10 namespace NST {
11  /***/
12  class Directory {
13  public:
14  // Public (de)Constructors
16  ~Directory();
24  Directory(const std::string & path, const std::vector<std::string> & exclusions = std::vector<std::string>());
30  Directory(const Buffer & package, const std::string & path, const std::vector<std::string> & exclusions = std::vector<std::string>());
33  Directory(const Directory & other);
36  Directory(Directory && other);
37 
38 
39  // Public Operators
43  Directory & operator=(const Directory & other);
47  Directory & operator=(Directory && other);
48 
49 
50  // Public Manipulation Methods
57  std::optional<Buffer> make_package() const;
59  bool apply_folder() const;
67  std::optional<Buffer> make_delta(const Directory & newDirectory) const;
71  bool apply_delta(const Buffer & diffBuffer);
72 
73 
74  // Public Accessor/Information Methods
77  size_t fileCount() const;
80  size_t byteCount() const;
83  static std::string GetStartMenuPath();
86  static std::string GetDesktopPath();
89  static std::string GetRunningDirectory();
93  static std::string SanitizePath(const std::string & path);
94 
95 
96  // Public Header Structs
98  // Attributes
99  size_t m_charCount = 0ull;
100  std::string m_folderName = "";
101 
102 
103  // (de)Constructors
104  PackageHeader() = default;
105  inline PackageHeader(const size_t & folderNameSize, const char * folderName) : Header("nSuite package"), m_charCount(folderNameSize) {
106  m_folderName = std::string(folderName, folderNameSize);
107  }
108 
109 
110  // Interface Implementation
111  inline virtual bool isValid() const override {
112  return (std::strcmp(m_title, "nSuite package") == 0);
113  }
114  inline virtual size_t size() const override {
115  return size_t(sizeof(size_t) + (sizeof(char) * m_charCount));
116  }
117  inline virtual std::byte * operator << (std::byte * ptr) override {
118  ptr = Header::operator<<(ptr);
119  std::copy(ptr, &ptr[size_t(sizeof(size_t))], reinterpret_cast<std::byte*>(&m_charCount));
120  ptr = &ptr[size_t(sizeof(size_t))];
121  char * folderArray = new char[m_charCount];
122  std::copy(ptr, &ptr[size_t(sizeof(char) * m_charCount)], reinterpret_cast<std::byte*>(&folderArray[0]));
123  m_folderName = std::string(folderArray, m_charCount);
124  delete[] folderArray;
125  return &ptr[size_t(sizeof(char) * m_charCount)];
126  }
127  inline virtual std::byte *operator >> (std::byte * ptr) const override {
128  ptr = Header::operator>>(ptr);
129  *reinterpret_cast<size_t*>(ptr) = m_charCount;
130  ptr = &ptr[size_t(sizeof(size_t))];
131  std::copy(m_folderName.begin(), m_folderName.end(), reinterpret_cast<char*>(ptr));
132  return &ptr[size_t(sizeof(char) * m_charCount)];
133  }
134  };
137  // Attributes
138  size_t m_fileCount = 0ull;
139 
140 
141  // (de)Constructors
142  inline PatchHeader(const size_t size = 0ull) : Header("nSuite patch"), m_fileCount(size) {}
143 
144 
145  // Interface Implementation
146  inline virtual bool isValid() const override {
147  return (std::strcmp(m_title, "nSuite patch") == 0);
148  }
149  inline virtual size_t size() const override {
150  return size_t(sizeof(size_t));
151  }
152  inline virtual std::byte * operator << (std::byte * ptr) override {
153  ptr = Header::operator<<(ptr);
154  std::copy(ptr, &ptr[size()], reinterpret_cast<std::byte*>(&m_fileCount));
155  return &ptr[size()];
156  }
157  inline virtual std::byte *operator >> (std::byte * ptr) const override {
158  ptr = Header::operator>>(ptr);
159  *reinterpret_cast<size_t*>(ptr) = m_fileCount;
160  return &ptr[size()];
161  }
162  };
163 
164 
165  private:
166  // Private Default Constructor
167  Directory() = default;
168 
169 
170  // Private Destruction Method
171  void devirtualize();
172 
173 
174  // Private Methods
177  void virtualize_folder(const std::string & path);
180  void virtualize_package(const Buffer & buffer);
181 
182 
183  // Private Attributes
184  struct DirFile {
185  std::string relativePath = "";
186  size_t size = 0ull;
187  std::byte * data = nullptr;
188  };
189  std::vector<DirFile> m_files;
190  std::string m_directoryPath = "", m_directoryName = "";
191  std::vector<std::string> m_exclusions;
192  };
193 };
194 
195 #endif // DIRECTORY_H
size_t fileCount() const
Definition: Directory.cpp:650
+
1 #pragma once
2 #ifndef DIRECTORY_H
3 #define DIRECTORY_H
4 
5 #include "Buffer.h"
6 #include <string>
7 #include <vector>
8 
9 
10 namespace NST {
13  class Directory {
14  public:
15  // Public (de)Constructors
17  ~Directory();
25  Directory(const std::string & path, const std::vector<std::string> & exclusions = std::vector<std::string>());
31  Directory(const Buffer & package, const std::string & path, const std::vector<std::string> & exclusions = std::vector<std::string>());
34  Directory(const Directory & other);
37  Directory(Directory && other);
38 
39 
40  // Public Operators
44  Directory & operator=(const Directory & other);
48  Directory & operator=(Directory && other);
49 
50 
51  // Public Manipulation Methods
58  std::optional<Buffer> make_package() const;
60  bool apply_folder() const;
68  std::optional<Buffer> make_delta(const Directory & newDirectory) const;
72  bool apply_delta(const Buffer & diffBuffer);
73 
74 
75  // Public Accessor/Information Methods
78  size_t fileCount() const;
81  size_t byteCount() const;
84  static std::string GetStartMenuPath();
87  static std::string GetDesktopPath();
90  static std::string GetRunningDirectory();
94  static std::string SanitizePath(const std::string & path);
95 
96 
97  // Public Header Structs
100  // Attributes
101  size_t m_charCount = 0ull;
102  std::string m_folderName = "";
103 
104 
105  // (de)Constructors
107  PackageHeader() = default;
111  inline PackageHeader(const size_t & folderNameSize, const char * folderName) : Header("nSuite package"), m_charCount(folderNameSize) {
112  m_folderName = std::string(folderName, folderNameSize);
113  }
114 
115 
116  // Interface Implementation
117  inline virtual bool isValid() const override {
118  return (std::strcmp(m_title, "nSuite package") == 0);
119  }
120  inline virtual size_t size() const override {
121  return size_t(sizeof(size_t) + (sizeof(char) * m_charCount));
122  }
123  inline virtual std::byte * operator << (std::byte * ptr) override {
124  ptr = Header::operator<<(ptr);
125  std::copy(ptr, &ptr[size_t(sizeof(size_t))], reinterpret_cast<std::byte*>(&m_charCount));
126  ptr = &ptr[size_t(sizeof(size_t))];
127  char * folderArray = new char[m_charCount];
128  std::copy(ptr, &ptr[size_t(sizeof(char) * m_charCount)], reinterpret_cast<std::byte*>(&folderArray[0]));
129  m_folderName = std::string(folderArray, m_charCount);
130  delete[] folderArray;
131  return &ptr[size_t(sizeof(char) * m_charCount)];
132  }
133  inline virtual std::byte *operator >> (std::byte * ptr) const override {
134  ptr = Header::operator>>(ptr);
135  *reinterpret_cast<size_t*>(ptr) = m_charCount;
136  ptr = &ptr[size_t(sizeof(size_t))];
137  std::copy(m_folderName.begin(), m_folderName.end(), reinterpret_cast<char*>(ptr));
138  return &ptr[size_t(sizeof(char) * m_charCount)];
139  }
140  };
143  // Attributes
144  size_t m_fileCount = 0ull;
145 
146 
147  // (de)Constructors
149  inline PatchHeader(const size_t size = 0ull) : Header("nSuite patch"), m_fileCount(size) {}
150 
151 
152  // Interface Implementation
153  inline virtual bool isValid() const override {
154  return (std::strcmp(m_title, "nSuite patch") == 0);
155  }
156  inline virtual size_t size() const override {
157  return size_t(sizeof(size_t));
158  }
159  inline virtual std::byte * operator << (std::byte * ptr) override {
160  ptr = Header::operator<<(ptr);
161  std::copy(ptr, &ptr[size()], reinterpret_cast<std::byte*>(&m_fileCount));
162  return &ptr[size()];
163  }
164  inline virtual std::byte *operator >> (std::byte * ptr) const override {
165  ptr = Header::operator>>(ptr);
166  *reinterpret_cast<size_t*>(ptr) = m_fileCount;
167  return &ptr[size()];
168  }
169  };
170 
171 
172  private:
173  // Private Default Constructor
174  Directory() = default;
175 
176 
177  // Private Destruction Method
178  void devirtualize();
179 
180 
181  // Private Methods
184  void virtualize_folder(const std::string & path);
187  void virtualize_package(const Buffer & buffer);
188 
189 
190  // Private Attributes
191  struct DirFile {
192  std::string relativePath = "";
193  size_t size = 0ull;
194  std::byte * data = nullptr;
195  };
196  std::vector<DirFile> m_files;
197  std::string m_directoryPath = "", m_directoryName = "";
198  std::vector<std::string> m_exclusions;
199  };
200 };
201 
202 #endif // DIRECTORY_H
size_t fileCount() const
Definition: Directory.cpp:650
Directory & operator=(const Directory &other)
Definition: Directory.cpp:134
-
virtual bool isValid() const override
Definition: Directory.h:146
-
virtual size_t size() const override
Definition: Directory.h:114
+ +
virtual bool isValid() const override
Definition: Directory.h:153
+
virtual size_t size() const override
Definition: Directory.h:120
static std::string GetRunningDirectory()
Definition: Directory.cpp:686
-
Definition: Directory.h:97
+
Definition: Directory.h:99
static std::string GetDesktopPath()
Definition: Directory.cpp:678
Definition: Buffer.h:11
-
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Directory.h:157
-
virtual bool isValid() const override
Definition: Directory.h:111
+
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Directory.h:164
+
virtual bool isValid() const override
Definition: Directory.h:117
std::optional< Buffer > make_delta(const Directory &newDirectory) const
Definition: Directory.cpp:271
static std::string GetStartMenuPath()
Definition: Directory.cpp:670
Definition: Buffer.h:149
~Directory()
Definition: Directory.cpp:58
static std::string SanitizePath(const std::string &path)
Definition: Directory.cpp:694
bool apply_folder() const
Definition: Directory.cpp:238
+
PatchHeader(const size_t size=0ull)
Definition: Directory.h:149
Definition: Buffer.h:8
std::optional< Buffer > make_package() const
Definition: Directory.cpp:173
-
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Directory.h:127
-
Definition: Directory.h:136
+
virtual std::byte * operator >>(std::byte *ptr) const override
Definition: Directory.h:133
+
Definition: Directory.h:142
size_t byteCount() const
Definition: Directory.cpp:655
-
Definition: Directory.h:12
-
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Directory.h:117
-
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Directory.h:152
+
Definition: Directory.h:13
+
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Directory.h:123
+
virtual std::byte * operator<<(std::byte *ptr) override
Definition: Directory.h:159
+
PackageHeader(const size_t &folderNameSize, const char *folderName)
Definition: Directory.h:111
bool apply_delta(const Buffer &diffBuffer)
Definition: Directory.cpp:403
-
virtual size_t size() const override
Definition: Directory.h:149
+
virtual size_t size() const override
Definition: Directory.h:156
-
1 #pragma once
2 #ifndef UNINSTALL_SCREEN_UN_H
3 #define UNINSTALL_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Uninstall_Screen : public Screen {
10 public:
11  // Public (de)Constructors
13  Uninstall_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void goFinish();
24 
25 
26  // Public Attributes
27  HWND m_hwndLog = nullptr, m_hwndPrgsBar = nullptr, m_btnFinish = nullptr;
28  size_t m_logIndex = 0ull, m_taskIndex = 0ull;
29 };
30 
31 #endif // UNINSTALL_SCREEN_UN_H
void goFinish()
Definition: Uninstall.cpp:97
+
1 #pragma once
2 #ifndef UNINSTALL_SCREEN_UN_H
3 #define UNINSTALL_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Uninstall_Screen : public Screen {
10 public:
11  // Public (de)Constructors
15  Uninstall_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void goFinish();
26 
27 
28  // Public Attributes
29  HWND m_hwndLog = nullptr, m_hwndPrgsBar = nullptr, m_btnFinish = nullptr;
30  size_t m_logIndex = 0ull, m_taskIndex = 0ull;
31 };
32 
33 #endif // UNINSTALL_SCREEN_UN_H
Uninstall_Screen(Uninstaller *uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Uninstall.cpp:21
+
void goFinish()
Definition: Uninstall.cpp:97
Definition: Screen.h:15
Definition: Screen.h:18
Definition: Uninstall.h:9
virtual void enact() override
Definition: Uninstall.cpp:66
+
~Uninstall_Screen()
Definition: Uninstall.cpp:10
virtual void paint() override
Definition: Uninstall.cpp:71
Definition: Uninstaller.h:14
diff --git a/docs/html/_uninstaller_2include_2_screens_2_fail_8h_source.html b/docs/html/_uninstaller_2include_2_screens_2_fail_8h_source.html index 38ada20..54cc6b9 100644 --- a/docs/html/_uninstaller_2include_2_screens_2_fail_8h_source.html +++ b/docs/html/_uninstaller_2include_2_screens_2_fail_8h_source.html @@ -71,12 +71,14 @@
Fail.h
-
1 #pragma once
2 #ifndef FAIL_SCREEN_UN_H
3 #define FAIL_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Fail_Screen: public Screen {
10 public:
11  // Public (de)Constructors
12  ~Fail_Screen();
13  Fail_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void goClose();
24 
25 
26  // Public Attributes
27  HWND m_hwndLog = nullptr, m_btnClose = nullptr;
28  size_t m_logIndex = 0ull;
29 };
30 
31 #endif // FAIL_SCREEN_UN_H
Definition: Screen.h:15
+
1 #pragma once
2 #ifndef FAIL_SCREEN_UN_H
3 #define FAIL_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Fail_Screen: public Screen {
10 public:
11  // Public (de)Constructors
13  ~Fail_Screen();
15  Fail_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void goClose();
26 
27 
28  // Public Attributes
29  HWND m_hwndLog = nullptr, m_btnClose = nullptr;
30  size_t m_logIndex = 0ull;
31 };
32 
33 #endif // FAIL_SCREEN_UN_H
Definition: Screen.h:15
Definition: Screen.h:18
virtual void enact() override
Definition: Fail.cpp:53
void goClose()
Definition: Fail.cpp:85
+
Fail_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Fail.cpp:19
virtual void paint() override
Definition: Fail.cpp:58
Definition: Uninstaller.h:14
+
~Fail_Screen()
Definition: Fail.cpp:10
Definition: Fail.h:9
diff --git a/docs/html/_uninstaller_2include_2_screens_2_finish_8h_source.html b/docs/html/_uninstaller_2include_2_screens_2_finish_8h_source.html index 925ca6c..ea9f5ef 100644 --- a/docs/html/_uninstaller_2include_2_screens_2_finish_8h_source.html +++ b/docs/html/_uninstaller_2include_2_screens_2_finish_8h_source.html @@ -71,12 +71,14 @@
Finish.h
-
1 #pragma once
2 #ifndef FINISH_SCREEN_UN_H
3 #define FINISH_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Finish_Screen: public Screen {
10 public:
11  // Public (de)Constructors
12  ~Finish_Screen();
13  Finish_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void goClose();
24 
25 
26  // Public Attributes
27  HWND m_btnClose = nullptr;
28 };
29 
30 #endif // FINISH_SCREEN_UN_H
Definition: Screen.h:15
+
1 #pragma once
2 #ifndef FINISH_SCREEN_UN_H
3 #define FINISH_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Finish_Screen: public Screen {
10 public:
11  // Public (de)Constructors
15  Finish_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void goClose();
26 
27 
28  // Public Attributes
29  HWND m_btnClose = nullptr;
30 };
31 
32 #endif // FINISH_SCREEN_UN_H
Finish_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Finish.cpp:20
+
Definition: Screen.h:15
Definition: Screen.h:18
Definition: Finish.h:11
void goClose()
Definition: Finish.cpp:136
virtual void paint() override
Definition: Finish.cpp:110
Definition: Uninstaller.h:14
+
~Finish_Screen()
Definition: Finish.cpp:10
virtual void enact() override
Definition: Finish.cpp:105
diff --git a/docs/html/_uninstaller_2include_2_screens_2_screen_8h_source.html b/docs/html/_uninstaller_2include_2_screens_2_screen_8h_source.html index 133308b..2dcc04e 100644 --- a/docs/html/_uninstaller_2include_2_screens_2_screen_8h_source.html +++ b/docs/html/_uninstaller_2include_2_screens_2_screen_8h_source.html @@ -71,7 +71,8 @@
Screen.h
-
1 #pragma once
2 #ifndef SCREEN_UN_H
3 #define SCREEN_UN_H
4 
5 #include <windows.h>
6 #pragma warning(push)
7 #pragma warning(disable:4458)
8 #include <gdiplus.h>
9 #pragma warning(pop)
10 
11 
12 using namespace Gdiplus;
13 class Uninstaller;
15 struct vec2 { int x = 0, y = 0; };
16 
18 class Screen {
19 public:
20  // Public (de)Constructors
21  Screen(Uninstaller * uninstaller, const vec2 & pos, const vec2 & size) : m_uninstaller(uninstaller), m_pos(pos), m_size(size) {}
22 
23 
24  // Public Methods
27  void setVisible(const bool & state) {
28  ShowWindow(m_hwnd, state);
29  EnableWindow(m_hwnd, state);
30  }
31 
32 
33  // Public Interface Declarations
35  virtual void enact() = 0;
37  virtual void paint() = 0;
38 
39 
40  // Public Attributes
41  Uninstaller * m_uninstaller = nullptr;
42  HWND m_hwnd = nullptr;
43 
44 
45 protected:
46  // Private Attributes
47  WNDCLASSEX m_wcex;
48  HINSTANCE m_hinstance;
49  vec2 m_pos, m_size;
50 };
51 
52 #endif // SCREEN_UN_H
void setVisible(const bool &state)
Definition: Screen.h:27
+
1 #pragma once
2 #ifndef SCREEN_UN_H
3 #define SCREEN_UN_H
4 
5 #include <windows.h>
6 #pragma warning(push)
7 #pragma warning(disable:4458)
8 #include <gdiplus.h>
9 #pragma warning(pop)
10 
11 
12 using namespace Gdiplus;
13 class Uninstaller;
15 struct vec2 { int x = 0, y = 0; };
16 
18 class Screen {
19 public:
20  // Public (de)Constructors
22  ~Screen() = default;
24  Screen(Uninstaller * uninstaller, const vec2 & pos, const vec2 & size) : m_uninstaller(uninstaller), m_pos(pos), m_size(size) {}
25 
26 
27  // Public Methods
30  void setVisible(const bool & state) {
31  ShowWindow(m_hwnd, state);
32  EnableWindow(m_hwnd, state);
33  }
34 
35 
36  // Public Interface Declarations
38  virtual void enact() = 0;
40  virtual void paint() = 0;
41 
42 
43  // Public Attributes
44  Uninstaller * m_uninstaller = nullptr;
45  HWND m_hwnd = nullptr;
46 
47 
48 protected:
49  // Private Attributes
50  WNDCLASSEX m_wcex;
51  HINSTANCE m_hinstance;
52  vec2 m_pos, m_size;
53 };
54 
55 #endif // SCREEN_UN_H
Screen(Uninstaller *uninstaller, const vec2 &pos, const vec2 &size)
Definition: Screen.h:24
+
void setVisible(const bool &state)
Definition: Screen.h:30
Definition: Screen.h:15
Definition: Screen.h:18
Definition: Uninstaller.h:14
diff --git a/docs/html/_uninstaller_2include_2_screens_2_welcome_8h_source.html b/docs/html/_uninstaller_2include_2_screens_2_welcome_8h_source.html index 7cee54c..14daf03 100644 --- a/docs/html/_uninstaller_2include_2_screens_2_welcome_8h_source.html +++ b/docs/html/_uninstaller_2include_2_screens_2_welcome_8h_source.html @@ -71,10 +71,12 @@
Welcome.h
-
1 #pragma once
2 #ifndef WELCOME_SCREEN_UN_H
3 #define WELCOME_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Welcome_Screen : public Screen {
10 public:
11  // Public (de)Constructors
12  ~Welcome_Screen();
13  Welcome_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
14 
15 
16  // Public Interface Implementations
17  virtual void enact() override;
18  virtual void paint() override;
19 
20 
21  // Public Methods
23  void goNext();
25  void goCancel();
26 
27 
28  // Public Attributes
29  HWND m_btnNext = nullptr, m_btnCancel = nullptr;
30 };
31 
32 #endif // WELCOME_SCREEN_UN_H
Definition: Screen.h:15
+
1 #pragma once
2 #ifndef WELCOME_SCREEN_UN_H
3 #define WELCOME_SCREEN_UN_H
4 
5 #include "Screen.h"
6 
7 
9 class Welcome_Screen : public Screen {
10 public:
11  // Public (de)Constructors
15  Welcome_Screen(Uninstaller * uninstaller, const HINSTANCE hInstance, const HWND parent, const vec2 & pos, const vec2 & size);
16 
17 
18  // Public Interface Implementations
19  virtual void enact() override;
20  virtual void paint() override;
21 
22 
23  // Public Methods
25  void goNext();
27  void goCancel();
28 
29 
30  // Public Attributes
31  HWND m_btnNext = nullptr, m_btnCancel = nullptr;
32 };
33 
34 #endif // WELCOME_SCREEN_UN_H
Welcome_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)
Definition: Welcome.cpp:15
+
Definition: Screen.h:15
Definition: Screen.h:18
void goCancel()
Definition: Welcome.cpp:93
virtual void enact() override
Definition: Welcome.cpp:43
+
~Welcome_Screen()
Definition: Welcome.cpp:7
Definition: Welcome.h:9
void goNext()
Definition: Welcome.cpp:88
virtual void paint() override
Definition: Welcome.cpp:48
diff --git a/docs/html/_uninstaller_8h_source.html b/docs/html/_uninstaller_8h_source.html index 76c7226..806e692 100644 --- a/docs/html/_uninstaller_8h_source.html +++ b/docs/html/_uninstaller_8h_source.html @@ -71,7 +71,7 @@
Uninstaller.h
-
1 #pragma once
2 #ifndef UNINSTALLER_H
3 #define UNINSTALLER_H
4 
5 #include "Resource.h"
6 #include "Threader.h"
7 #include <map>
8 #include <string>
9 
10 
11 class Screen;
12 
14 class Uninstaller {
15 public:
16  // Public (de)Constructors
17  ~Uninstaller() = default;
18  Uninstaller(const HINSTANCE hInstance);
19 
20 
21  // Public Enumerations
22  const enum ScreenEnums {
23  WELCOME_SCREEN, UNINSTALL_SCREEN, FINISH_SCREEN, FAIL_SCREEN,
24  SCREEN_COUNT
25  };
26 
27 
28  // Public Methods
30  void invalidate();
33  void setScreen(const ScreenEnums & screenIndex);
36  std::wstring getDirectory() const;
38  void beginUninstallation();
40  static void dumpErrorLog();
42  void paint();
43 
44 
45  // Public manifest strings
47  struct compare_string {
48  bool operator()(const wchar_t * a, const wchar_t * b) const {
49  return wcscmp(a, b) < 0;
50  }
51  };
52  std::map<const wchar_t*, std::wstring, compare_string> m_mfStrings;
53 
54 
55 private:
56  // Private Constructors
57  Uninstaller();
58 
59 
60  // Private Attributes
61  NST::Threader m_threader;
62  NST::Resource m_manifest;
63  std::wstring m_directory = L"";
64  bool m_valid = true;
65  ScreenEnums m_currentIndex = WELCOME_SCREEN;
66  Screen * m_screens[SCREEN_COUNT];
67  HWND m_hwnd = nullptr;
68 };
69 
70 
71 #endif // UNINSTALLER_H
void invalidate()
Definition: Uninstaller.cpp:127
+
1 #pragma once
2 #ifndef UNINSTALLER_H
3 #define UNINSTALLER_H
4 
5 #include "Resource.h"
6 #include "Threader.h"
7 #include <map>
8 #include <string>
9 
10 
11 class Screen;
12 
14 class Uninstaller {
15 public:
16  // Public (de)Constructors
18  ~Uninstaller() = default;
20  Uninstaller(const HINSTANCE hInstance);
21 
22 
23  // Public Enumerations
25  const enum ScreenEnums {
26  WELCOME_SCREEN, UNINSTALL_SCREEN, FINISH_SCREEN, FAIL_SCREEN,
27  SCREEN_COUNT
28  };
29 
30 
31  // Public Methods
33  void invalidate();
36  void setScreen(const ScreenEnums & screenIndex);
39  std::wstring getDirectory() const;
41  void beginUninstallation();
43  static void dumpErrorLog();
45  void paint();
46 
47 
48  // Public manifest strings
50  struct compare_string {
52  bool operator()(const wchar_t * a, const wchar_t * b) const {
53  return std::wcscmp(a, b) < 0;
54  }
55  };
56  std::map<const wchar_t*, std::wstring, compare_string> m_mfStrings;
57 
58 
59 private:
60  // Private Constructors
61  Uninstaller();
62 
63 
64  // Private Attributes
65  NST::Threader m_threader;
66  NST::Resource m_manifest;
67  std::wstring m_directory = L"";
68  bool m_valid = true;
69  ScreenEnums m_currentIndex = WELCOME_SCREEN;
70  Screen * m_screens[SCREEN_COUNT];
71  HWND m_hwnd = nullptr;
72 };
73 
74 
75 #endif // UNINSTALLER_H
void invalidate()
Definition: Uninstaller.cpp:127
Definition: Screen.h:18
static void dumpErrorLog()
Definition: Uninstaller.cpp:240
Definition: Resource.h:31
@@ -79,9 +79,12 @@
std::wstring getDirectory() const
Definition: Uninstaller.cpp:145
void setScreen(const ScreenEnums &screenIndex)
Definition: Uninstaller.cpp:133
void beginUninstallation()
Definition: Uninstaller.cpp:150
+
~Uninstaller()=default
+
bool operator()(const wchar_t *a, const wchar_t *b) const
Definition: Uninstaller.h:52
Definition: Threader.h:14
+
ScreenEnums
Definition: Uninstaller.h:25
Definition: Uninstaller.h:14
-
Definition: Uninstaller.h:47
+
Definition: Uninstaller.h:50

Constructor & Destructor Documentation

+ +

◆ ~Agreement_Screen()

+ +
+
+ + + + + + + +
Agreement_Screen::~Agreement_Screen ()
+
+

Destroy this screen.

+ +
+
+ +

◆ Agreement_Screen()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Agreement_Screen::Agreement_Screen (Installerinstaller,
const HINSTANCE hInstance,
const HWND parent,
const vec2pos,
const vec2size 
)
+
+

Construct this screen.

+ +
+
+

Member Function Documentation

◆ checkYes()

diff --git a/docs/html/class_directory___screen-members.html b/docs/html/class_directory___screen-members.html index 9026244..79907e7 100644 --- a/docs/html/class_directory___screen-members.html +++ b/docs/html/class_directory___screen-members.html @@ -71,7 +71,7 @@

This is the complete list of members for Directory_Screen, including all inherited members.

- + @@ -90,11 +90,13 @@ - - + + - + + +
browse()Directory_Screen
Directory_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size) (defined in Directory_Screen)Directory_Screen
Directory_Screen(Installer *installer, const HINSTANCE hInstance, const HWND parent, const vec2 &pos, const vec2 &size)Directory_Screen
enact() overrideDirectory_Screenvirtual
goCancel()Directory_Screen
goInstall()Directory_Screen
m_uninstaller (defined in Screen)Screen
m_wcex (defined in Screen)Screenprotected
paint() overrideDirectory_Screenvirtual
Screen(Installer *installer, const vec2 &pos, const vec2 &size) (defined in Screen)Screeninline
Screen(Uninstaller *uninstaller, const vec2 &pos, const vec2 &size) (defined in Screen)Screeninline
Screen(Installer *installer, const vec2 &pos, const vec2 &size)Screeninline
Screen(Uninstaller *uninstaller, const vec2 &pos, const vec2 &size)Screeninline
setVisible(const bool &state)Screeninline
setVisible(const bool &state)Screeninline
~Directory_Screen() (defined in Directory_Screen)Directory_Screen
~Directory_Screen()Directory_Screen
~Screen()=defaultScreen
~Screen()=defaultScreen