summaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/files.cpp2
-rw-r--r--src/fs/files_unittest.cc2
-rw-r--r--src/fs/paths.cpp3
-rw-r--r--src/fs/virtfs.h81
-rw-r--r--src/fs/virtfs/virtfs.cpp3
-rw-r--r--src/fs/virtfs/virtfs.h53
-rw-r--r--src/fs/virtfs/virtfs_unittest.cc5
-rw-r--r--src/fs/virtfs_unittest.cc3
-rw-r--r--src/fs/virtfsrwops.cpp2
-rw-r--r--src/fs/virtfstools.cpp2
10 files changed, 61 insertions, 95 deletions
diff --git a/src/fs/files.cpp b/src/fs/files.cpp
index dca24aec1..efaadfe8f 100644
--- a/src/fs/files.cpp
+++ b/src/fs/files.cpp
@@ -23,7 +23,7 @@
#include "fs/mkdir.h"
#if defined(ANDROID) || defined(__native_client__)
#include "fs/paths.h"
-#include "fs/virtfs.h"
+#include "fs/virtfs/virtfs.h"
#include "fs/virtfstools.h"
#include "fs/virtlist.h"
#endif // defined(ANDROID) || defined(__native_client__)
diff --git a/src/fs/files_unittest.cc b/src/fs/files_unittest.cc
index 473e0cbdc..b4ff18851 100644
--- a/src/fs/files_unittest.cc
+++ b/src/fs/files_unittest.cc
@@ -23,7 +23,7 @@
#include "catch.hpp"
#include "logger.h"
-#include "fs/virtfs.h"
+#include "fs/virtfs/virtfs.h"
#include "fs/virtfstools.h"
#include "utils/delete2.h"
diff --git a/src/fs/paths.cpp b/src/fs/paths.cpp
index bcfbf6c4d..a5941f084 100644
--- a/src/fs/paths.cpp
+++ b/src/fs/paths.cpp
@@ -25,7 +25,8 @@
#endif // _MSC_VER
#include "fs/paths.h"
-#include "fs/virtfs.h"
+
+#include "fs/virtfs/virtfs.h"
#include "utils/checkutils.h"
#include "utils/stringutils.h"
diff --git a/src/fs/virtfs.h b/src/fs/virtfs.h
deleted file mode 100644
index e73aa741f..000000000
--- a/src/fs/virtfs.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * The ManaPlus Client
- * Copyright (C) 2013-2017 The ManaPlus Developers
- *
- * This file is part of The ManaPlus Client.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef FS_VIRTFS_H
-#define FS_VIRTFS_H
-
-#include "enums/simpletypes/append.h"
-
-#include "localconsts.h"
-
-#include <string>
-
-struct VirtFile;
-struct VirtList;
-
-namespace VirtFs
-{
- void init(const std::string &restrict name);
- void updateDirSeparator();
- const char *getDirSeparator();
- const char *getBaseDir();
- const char *getUserDir();
- bool exists(std::string name);
- VirtList *enumerateFiles(std::string dir) RETURNS_NONNULL;
- bool isDirectory(std::string name);
- bool isSymbolicLink(const std::string &restrict name);
- void freeList(VirtList *restrict const handle);
- VirtFile *openRead(std::string filename);
- VirtFile *openWrite(std::string filename);
- VirtFile *openAppend(std::string filename);
- bool setWriteDir(const std::string &restrict newDir);
- bool mountDir(std::string newDir,
- const Append append);
- bool mountDirSilent(std::string newDir,
- const Append append);
- bool unmountDir(std::string oldDir);
- bool unmountDirSilent(std::string oldDir);
- bool mountZip(std::string newDir,
- const Append append);
- bool unmountZip(std::string oldDir);
- std::string getRealDir(std::string filename);
- bool mkdir(const std::string &restrict dirName);
- bool remove(const std::string &restrict filename);
- bool deinit();
- void permitLinks(const bool val);
- int64_t read(VirtFile *restrict const handle,
- void *restrict const buffer,
- const uint32_t objSize,
- const uint32_t objCount);
- int64_t write(VirtFile *restrict const file,
- const void *restrict const buffer,
- const uint32_t objSize,
- const uint32_t objCount);
- int close(VirtFile *restrict const file);
- int64_t fileLength(VirtFile *restrict const file);
- int64_t tell(VirtFile *restrict const file);
- int seek(VirtFile *restrict const file,
- const uint64_t pos);
- int eof(VirtFile *restrict const file);
-} // namespace VirtFs
-
-extern const char *dirSeparator;
-
-#endif // FS_VIRTFS_H
diff --git a/src/fs/virtfs/virtfs.cpp b/src/fs/virtfs/virtfs.cpp
index 36aab8eab..8718a9738 100644
--- a/src/fs/virtfs/virtfs.cpp
+++ b/src/fs/virtfs/virtfs.cpp
@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "fs/virtfs.h"
+#include "fs/virtfs/virtfs.h"
#include "fs/files.h"
#include "fs/paths.h"
@@ -27,7 +27,6 @@
#include "fs/virtlist.h"
#include "fs/virtfs/virtdirentry.h"
-#include "fs/virtfs/virtfs.h"
#include "fs/virtfs/virtfsdir.h"
#include "fs/virtfs/virtfszip.h"
#include "fs/virtfs/virtzipentry.h"
diff --git a/src/fs/virtfs/virtfs.h b/src/fs/virtfs/virtfs.h
index 408a54832..ed6b27a3d 100644
--- a/src/fs/virtfs/virtfs.h
+++ b/src/fs/virtfs/virtfs.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef UTILS_FS_VIRTFS_VIRTFS_H
-#define UTILS_FS_VIRTFS_VIRTFS_H
+#ifndef FS_VIRTFS_H
+#define FS_VIRTFS_H
#include "enums/fs/fsentrytype.h"
@@ -30,10 +30,55 @@
#include <string>
#include <vector>
+struct VirtFile;
struct VirtFsEntry;
+struct VirtList;
namespace VirtFs
{
+ void init(const std::string &restrict name);
+ void updateDirSeparator();
+ const char *getDirSeparator();
+ const char *getBaseDir();
+ const char *getUserDir();
+ bool exists(std::string name);
+ VirtList *enumerateFiles(std::string dir) RETURNS_NONNULL;
+ bool isDirectory(std::string name);
+ bool isSymbolicLink(const std::string &restrict name);
+ void freeList(VirtList *restrict const handle);
+ VirtFile *openRead(std::string filename);
+ VirtFile *openWrite(std::string filename);
+ VirtFile *openAppend(std::string filename);
+ bool setWriteDir(const std::string &restrict newDir);
+ bool mountDir(std::string newDir,
+ const Append append);
+ bool mountDirSilent(std::string newDir,
+ const Append append);
+ bool unmountDir(std::string oldDir);
+ bool unmountDirSilent(std::string oldDir);
+ bool mountZip(std::string newDir,
+ const Append append);
+ bool unmountZip(std::string oldDir);
+ std::string getRealDir(std::string filename);
+ bool mkdir(const std::string &restrict dirName);
+ bool remove(const std::string &restrict filename);
+ bool deinit();
+ void permitLinks(const bool val);
+ int64_t read(VirtFile *restrict const handle,
+ void *restrict const buffer,
+ const uint32_t objSize,
+ const uint32_t objCount);
+ int64_t write(VirtFile *restrict const file,
+ const void *restrict const buffer,
+ const uint32_t objSize,
+ const uint32_t objCount);
+ int close(VirtFile *restrict const file);
+ int64_t fileLength(VirtFile *restrict const file);
+ int64_t tell(VirtFile *restrict const file);
+ int seek(VirtFile *restrict const file,
+ const uint64_t pos);
+ int eof(VirtFile *restrict const file);
+
bool mountDirInternal(const std::string &restrict newDir,
const Append append);
bool unmountDirInternal(std::string oldDir);
@@ -50,4 +95,6 @@ namespace VirtFs
#endif // UNITTESTS
} // namespace VirtFs
-#endif // UTILS_FS_VIRTFS_VIRTFS_H
+extern const char *dirSeparator;
+
+#endif // FS_VIRTFS_H
diff --git a/src/fs/virtfs/virtfs_unittest.cc b/src/fs/virtfs/virtfs_unittest.cc
index 1d5087e05..57031bd54 100644
--- a/src/fs/virtfs/virtfs_unittest.cc
+++ b/src/fs/virtfs/virtfs_unittest.cc
@@ -21,12 +21,11 @@
#include "catch.hpp"
#include "fs/files.h"
-#include "fs/virtfs.h"
-#include "fs/virtfstools.h"
-#include "fs/virtlist.h"
#include "fs/virtfs/virtdirentry.h"
#include "fs/virtfs/virtfs.h"
+#include "fs/virtfstools.h"
+#include "fs/virtlist.h"
#include "utils/checkutils.h"
#include "utils/delete2.h"
diff --git a/src/fs/virtfs_unittest.cc b/src/fs/virtfs_unittest.cc
index a5844c032..34b2620db 100644
--- a/src/fs/virtfs_unittest.cc
+++ b/src/fs/virtfs_unittest.cc
@@ -22,7 +22,8 @@
#include "fs/files.h"
#include "fs/paths.h"
-#include "fs/virtfs.h"
+
+#include "fs/virtfs/virtfs.h"
#include "fs/virtfstools.h"
#include "fs/virtlist.h"
diff --git a/src/fs/virtfsrwops.cpp b/src/fs/virtfsrwops.cpp
index 8b1ccd4cc..d44959f9a 100644
--- a/src/fs/virtfsrwops.cpp
+++ b/src/fs/virtfsrwops.cpp
@@ -46,7 +46,7 @@
#include "logger.h"
-#include "fs/virtfs.h"
+#include "fs/virtfs/virtfs.h"
#ifdef DEBUG_VIRTFS
#include "utils/debugmemoryobject.h"
diff --git a/src/fs/virtfstools.cpp b/src/fs/virtfstools.cpp
index 2aba0738a..9e290f959 100644
--- a/src/fs/virtfstools.cpp
+++ b/src/fs/virtfstools.cpp
@@ -23,8 +23,8 @@
#include "logger.h"
#include "fs/paths.h"
-#include "fs/virtfs.h"
+#include "fs/virtfs/virtfs.h"
#include "fs/virtlist.h"
#include "utils/stringutils.h"