diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-03-28 18:48:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-28 18:48:11 +0300 |
commit | 3b004486a0dbcdcb586b5f190aef980294729926 (patch) | |
tree | 1f9beddd62f298c40889fa8299b1f889a19e125f /src/fs/virtfs | |
parent | df287d79b978cdd97f6bf406bfbb19e2b32702d2 (diff) | |
download | plus-3b004486a0dbcdcb586b5f190aef980294729926.tar.gz plus-3b004486a0dbcdcb586b5f190aef980294729926.tar.bz2 plus-3b004486a0dbcdcb586b5f190aef980294729926.tar.xz plus-3b004486a0dbcdcb586b5f190aef980294729926.zip |
Move virtfsfuncs.h into virtfs directory.
Diffstat (limited to 'src/fs/virtfs')
-rw-r--r-- | src/fs/virtfs/virtfs.cpp | 2 | ||||
-rw-r--r-- | src/fs/virtfs/virtfsdir.cpp | 2 | ||||
-rw-r--r-- | src/fs/virtfs/virtfsfuncs.h | 88 | ||||
-rw-r--r-- | src/fs/virtfs/virtfszip.cpp | 2 |
4 files changed, 91 insertions, 3 deletions
diff --git a/src/fs/virtfs/virtfs.cpp b/src/fs/virtfs/virtfs.cpp index 19e42fab7..940bdb055 100644 --- a/src/fs/virtfs/virtfs.cpp +++ b/src/fs/virtfs/virtfs.cpp @@ -26,7 +26,7 @@ #include "fs/virtfs/virtdirentry.h" #include "fs/virtfs/virtfile.h" #include "fs/virtfs/virtfsdir.h" -#include "fs/virtfsfuncs.h" +#include "fs/virtfs/virtfsfuncs.h" #include "fs/virtfs/virtfszip.h" #include "fs/virtlist.h" #include "fs/virtfs/virtzipentry.h" diff --git a/src/fs/virtfs/virtfsdir.cpp b/src/fs/virtfs/virtfsdir.cpp index ba1961649..4e847f6cb 100644 --- a/src/fs/virtfs/virtfsdir.cpp +++ b/src/fs/virtfs/virtfsdir.cpp @@ -27,7 +27,7 @@ #include "fs/virtfs/virtdirentry.h" #include "fs/virtfs/virtfile.h" #include "fs/virtfs/virtfileprivate.h" -#include "fs/virtfsfuncs.h" +#include "fs/virtfs/virtfsfuncs.h" #include "fs/virtlist.h" #include "utils/checkutils.h" diff --git a/src/fs/virtfs/virtfsfuncs.h b/src/fs/virtfs/virtfsfuncs.h new file mode 100644 index 000000000..46bcd86ff --- /dev/null +++ b/src/fs/virtfs/virtfsfuncs.h @@ -0,0 +1,88 @@ +/* + * 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 UTILS_VIRTFSFUNCS_H +#define UTILS_VIRTFSFUNCS_H + +#include "utils/stringvector.h" + +#include "localconsts.h" + +struct VirtFile; +struct VirtFsEntry; + +struct VirtFsFuncs final +{ + VirtFsFuncs() : + close(nullptr), + read(nullptr), + write(nullptr), + fileLength(nullptr), + tell(nullptr), + seek(nullptr), + exists(nullptr), + getRealDir(nullptr), + enumerate(nullptr), + isDirectory(nullptr), + openRead(nullptr), + openWrite(nullptr), + openAppend(nullptr), + eof(nullptr) + { + } + + A_DELETE_COPY(VirtFsFuncs) + + int (*close) (VirtFile *restrict const file); + int64_t (*read) (VirtFile *restrict const file, + 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); + int64_t (*fileLength) (VirtFile *restrict const file); + int64_t (*tell) (VirtFile *restrict const file); + int (*seek) (VirtFile *restrict const file, + const uint64_t pos); + bool (*exists) (VirtFsEntry *restrict const entry, + const std::string &filename, + const std::string &dirName); + bool (*getRealDir) (VirtFsEntry *restrict const entry, + const std::string &filename, + const std::string &dirName, + std::string &realDir); + void (*enumerate) (VirtFsEntry *restrict const entry, + const std::string &dirName, + StringVect &names); + bool (*isDirectory) (VirtFsEntry *restrict const entry, + const std::string &dirName, + bool &isDirFlag); + VirtFile *(*openRead) (VirtFsEntry *restrict const entry, + const std::string &filename); + VirtFile *(*openWrite) (VirtFsEntry *restrict const entry, + const std::string &filename); + VirtFile *(*openAppend) (VirtFsEntry *restrict const entry, + const std::string &filename); + int (*eof) (VirtFile *restrict const file); +}; + +#endif // UTILS_VIRTFSFUNCS_H diff --git a/src/fs/virtfs/virtfszip.cpp b/src/fs/virtfs/virtfszip.cpp index a28f4d89f..ce08b935b 100644 --- a/src/fs/virtfs/virtfszip.cpp +++ b/src/fs/virtfs/virtfszip.cpp @@ -22,7 +22,7 @@ #include "fs/virtfs/virtfile.h" #include "fs/virtfs/virtfileprivate.h" -#include "fs/virtfsfuncs.h" +#include "fs/virtfs/virtfsfuncs.h" #include "fs/virtlist.h" #include "fs/virtfs/virtzipentry.h" #include "fs/virtfs/zip.h" |