[CABMAN] Move CCFDATAStorage to a separate header

This commit is contained in:
Mark Jansen 2020-08-30 20:38:43 +02:00
parent 7394d12f7e
commit 63f3275d15
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
5 changed files with 41 additions and 28 deletions

View file

@ -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@users.sourceforge.net)
* Copyright 2017 Colin Finck <mail@colinfinck.de>
* Copyright 2018 Dmitry Bagdanov <dimbo_job@mail.ru>
* Copyright 2018 Dmitry Bagdanov <dimbo_job@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"

View file

@ -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 */

View file

@ -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)

View file

@ -24,6 +24,7 @@
# include <sys/types.h>
#endif
#include "cabinet.h"
#include "CCFDATAStorage.h"
#include "raw.h"
#include "mszip.h"

View file

@ -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;