https://git.reactos.org/?p=reactos.git;a=commitdiff;h=63f3275d154e7a91d74ad…
commit 63f3275d154e7a91d74adcbf3cdba7210257b528
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Aug 30 20:38:43 2020 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Mon Sep 7 22:16:42 2020 +0200
[CABMAN] Move CCFDATAStorage to a separate header
---
sdk/tools/cabman/CCFDATAStorage.cxx | 6 +++---
sdk/tools/cabman/CCFDATAStorage.h | 34 ++++++++++++++++++++++++++++++++++
sdk/tools/cabman/CMakeLists.txt | 3 ++-
sdk/tools/cabman/cabinet.cxx | 1 +
sdk/tools/cabman/cabinet.h | 25 +------------------------
5 files changed, 41 insertions(+), 28 deletions(-)
diff --git a/sdk/tools/cabman/CCFDATAStorage.cxx b/sdk/tools/cabman/CCFDATAStorage.cxx
index b1790791c0b..c120af09f4a 100644
--- a/sdk/tools/cabman/CCFDATAStorage.cxx
+++ b/sdk/tools/cabman/CCFDATAStorage.cxx
@@ -1,10 +1,10 @@
/*
* PROJECT: ReactOS cabinet manager
* LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
- * PURPOSE: CCFDATAStorage class implementation for Linux/Unix
+ * PURPOSE: CCFDATAStorage class implementation
* COPYRIGHT: Copyright 2017 Casper S. Hornstrup (chorns(a)users.sourceforge.net)
* Copyright 2017 Colin Finck <mail(a)colinfinck.de>
- * Copyright 2018 Dmitry Bagdanov <dimbo_job(a)mail.ru>
+ * Copyright 2018 Dmitry Bagdanov <dimbo_job(a)mail.ru>
*/
#include <stdio.h>
#include <stdlib.h>
@@ -16,7 +16,7 @@
#include <dirent.h>
#endif
-#include "cabinet.h"
+#include "CCFDATAStorage.h"
#include "raw.h"
#include "mszip.h"
diff --git a/sdk/tools/cabman/CCFDATAStorage.h b/sdk/tools/cabman/CCFDATAStorage.h
new file mode 100644
index 00000000000..2382469636c
--- /dev/null
+++ b/sdk/tools/cabman/CCFDATAStorage.h
@@ -0,0 +1,34 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS cabinet manager
+ * FILE: tools/cabman/cabman.h
+ * PURPOSE: Cabinet manager header
+ */
+
+#pragma once
+
+#include "cabinet.h"
+
+#ifndef CAB_READ_ONLY
+
+class CCFDATAStorage
+{
+public:
+ /* Default constructor */
+ CCFDATAStorage();
+ /* Default destructor */
+ virtual ~CCFDATAStorage();
+ ULONG Create();
+ ULONG Destroy();
+ ULONG Truncate();
+ ULONG Position();
+ ULONG Seek(LONG Position);
+ ULONG ReadBlock(PCFDATA Data, void* Buffer, PULONG BytesRead);
+ ULONG WriteBlock(PCFDATA Data, void* Buffer, PULONG BytesWritten);
+private:
+ char FullName[PATH_MAX];
+ FILE* FileHandle;
+};
+
+#endif /* CAB_READ_ONLY */
+
diff --git a/sdk/tools/cabman/CMakeLists.txt b/sdk/tools/cabman/CMakeLists.txt
index 16464fb9ab2..2f6f05ca5da 100644
--- a/sdk/tools/cabman/CMakeLists.txt
+++ b/sdk/tools/cabman/CMakeLists.txt
@@ -12,7 +12,8 @@ list(APPEND SOURCE
mszip.h
raw.cxx
raw.h
- CCFDATAStorage.cxx)
+ CCFDATAStorage.cxx
+ CCFDATAStorage.h)
add_host_tool(cabman ${SOURCE})
target_link_libraries(cabman PRIVATE host_includes zlibhost)
diff --git a/sdk/tools/cabman/cabinet.cxx b/sdk/tools/cabman/cabinet.cxx
index 1f0d2766a12..1db3ce4e07a 100644
--- a/sdk/tools/cabman/cabinet.cxx
+++ b/sdk/tools/cabman/cabinet.cxx
@@ -24,6 +24,7 @@
# include <sys/types.h>
#endif
#include "cabinet.h"
+#include "CCFDATAStorage.h"
#include "raw.h"
#include "mszip.h"
diff --git a/sdk/tools/cabman/cabinet.h b/sdk/tools/cabman/cabinet.h
index d47f87893cd..a78d3553d6d 100644
--- a/sdk/tools/cabman/cabinet.h
+++ b/sdk/tools/cabman/cabinet.h
@@ -308,29 +308,6 @@ public:
/* Classes */
-#ifndef CAB_READ_ONLY
-
-class CCFDATAStorage
-{
-public:
- /* Default constructor */
- CCFDATAStorage();
- /* Default destructor */
- virtual ~CCFDATAStorage();
- ULONG Create();
- ULONG Destroy();
- ULONG Truncate();
- ULONG Position();
- ULONG Seek(LONG Position);
- ULONG ReadBlock(PCFDATA Data, void* Buffer, PULONG BytesRead);
- ULONG WriteBlock(PCFDATA Data, void* Buffer, PULONG BytesWritten);
-private:
- char FullName[PATH_MAX];
- FILE* FileHandle;
-};
-
-#endif /* CAB_READ_ONLY */
-
class CCabinet
{
public:
@@ -508,7 +485,7 @@ private:
bool CreateNewDisk;
bool CreateNewFolder;
- CCFDATAStorage *ScratchFile;
+ class CCFDATAStorage *ScratchFile;
FILE* SourceFile;
bool ContinueFile;
ULONG TotalBytesLeft;