- put the entire filesystem code into a namespace and created some subdirectories.

This commit is contained in:
Christoph Oelckers 2023-08-22 21:20:28 +02:00
commit ebb71cebf1
108 changed files with 308 additions and 225 deletions

View file

@ -0,0 +1,6 @@
#pragma once
#include "fs_files.h"
using FileSys::FileReader;
using FileSys::FileWriter;
using FileSys::BufferWriter;

View file

@ -0,0 +1,7 @@
#pragma once
#include "fs_filesystem.h"
using FileSys::FileSystem;
using FileSys::FResourceFile;
inline FileSys::FileSystem fileSystem;

View file

@ -3,8 +3,7 @@
#include <stdint.h>
#include "memarena.h"
#include "palentry.h"
class FileReader;
#include "files.h"
enum
{

View file

@ -57,6 +57,8 @@
#include "base64.h"
#include "vm.h"
using namespace FileSys;
extern DObject *WP_NOCHANGE;
bool save_full = false; // for testing. Should be removed afterward.

View file

@ -4,7 +4,6 @@
#include <stdint.h>
#include <type_traits>
#include "tarray.h"
#include "file_zip.h"
#include "tflags.h"
#include "vectors.h"
#include "palentry.h"
@ -80,7 +79,7 @@ public:
void SetUniqueSoundNames() { soundNamesAreUnique = true; }
bool OpenWriter(bool pretty = true);
bool OpenReader(const char *buffer, size_t length);
bool OpenReader(FCompressedBuffer *input);
bool OpenReader(FileSys::FCompressedBuffer *input);
void Close();
void ReadObjects(bool hubtravel);
bool BeginObject(const char *name);
@ -91,7 +90,7 @@ public:
unsigned GetSize(const char *group);
const char *GetKey();
const char *GetOutput(unsigned *len = nullptr);
FCompressedBuffer GetCompressedOutput();
FileSys::FCompressedBuffer GetCompressedOutput();
// The sprite serializer is a special case because it is needed by the VM to handle its 'spriteid' type.
virtual FSerializer &Sprite(const char *key, int32_t &spritenum, int32_t *def);
// This is only needed by the type system.