V-Gears 0
Free Final Fantasy VII engine.
FileSystem.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <OgreString.h>
19
24
25 public:
26
30 FileSystem() = delete;
31
38 static unsigned int GetFileSize(const Ogre::String& path);
39
49 static bool ReadFile(
50 const Ogre::String &path, void* buffer,
51 const unsigned int start, const unsigned int length
52 );
53
64 static bool WriteFile(
65 const Ogre::String &path, const void* buffer, const unsigned int length
66 );
67
78 static bool WriteNewFile(
79 const Ogre::String &path, const void* buffer,const unsigned int length
80 );
81
88 static bool RemoveFile(const Ogre::String &path);
89};
90
Static class which allows filesystem manipulation.
Definition: FileSystem.h:23
static bool WriteNewFile(const Ogre::String &path, const void *buffer, const unsigned int length)
Writes the contents of a buffer to new a file.
Definition: FileSystem.cpp:62
static bool ReadFile(const Ogre::String &path, void *buffer, const unsigned int start, const unsigned int length)
Reads a file contents and saves them to a buffer.
Definition: FileSystem.cpp:33
static bool RemoveFile(const Ogre::String &path)
Deletes a file.
Definition: FileSystem.cpp:69
static unsigned int GetFileSize(const Ogre::String &path)
Retrieves a file size.
Definition: FileSystem.cpp:20
static bool WriteFile(const Ogre::String &path, const void *buffer, const unsigned int length)
Writes the contents of a buffer to a file.
Definition: FileSystem.cpp:52
FileSystem()=delete
Destructor.
Ogre::String String
Definition: TypeDefine.h:37