diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-05 19:21:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-05 19:21:42 +0300 |
commit | ab311005113b2648cf5d709ec2a12baea90ede95 (patch) | |
tree | cf79250d77babb1fea16bb007bbd9a5bcae1aa65 /src/fs | |
parent | 77cc5e96c21aac8e1572824a7bf9a2c15ea1ba64 (diff) | |
download | manaverse-ab311005113b2648cf5d709ec2a12baea90ede95.tar.gz manaverse-ab311005113b2648cf5d709ec2a12baea90ede95.tar.bz2 manaverse-ab311005113b2648cf5d709ec2a12baea90ede95.tar.xz manaverse-ab311005113b2648cf5d709ec2a12baea90ede95.zip |
Rename virtlist into list.
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/files.cpp | 6 | ||||
-rw-r--r-- | src/fs/virtfs/fs.cpp | 8 | ||||
-rw-r--r-- | src/fs/virtfs/fs.h | 6 | ||||
-rw-r--r-- | src/fs/virtfs/fsdir.cpp | 4 | ||||
-rw-r--r-- | src/fs/virtfs/fsdir.h | 4 | ||||
-rw-r--r-- | src/fs/virtfs/fszip.cpp | 4 | ||||
-rw-r--r-- | src/fs/virtfs/fszip.h | 4 | ||||
-rw-r--r-- | src/fs/virtfs/list.cpp (renamed from src/fs/virtfs/virtlist.cpp) | 6 | ||||
-rw-r--r-- | src/fs/virtfs/list.h (renamed from src/fs/virtfs/virtlist.h) | 8 | ||||
-rw-r--r-- | src/fs/virtfs/tools.cpp | 6 | ||||
-rw-r--r-- | src/fs/virtfs/virtfs1_unittest.cc | 22 | ||||
-rw-r--r-- | src/fs/virtfs/virtfs_unittest.cc | 14 |
12 files changed, 46 insertions, 46 deletions
diff --git a/src/fs/files.cpp b/src/fs/files.cpp index f0d15a328..e31d331a4 100644 --- a/src/fs/files.cpp +++ b/src/fs/files.cpp @@ -26,7 +26,7 @@ #include "fs/virtfs/fs.h" #include "fs/virtfs/tools.h" -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #endif // defined(ANDROID) || defined(__native_client__) #include "utils/checkutils.h" @@ -48,7 +48,7 @@ void Files::extractLocale() VirtFs::mountZip(fileName2, Append_false); const std::string localDir = std::string(getenv("APPDIR")); - VirtFs::VirtList *const rootDirs = VirtFs::enumerateFiles("locale"); + VirtFs::List *const rootDirs = VirtFs::enumerateFiles("locale"); FOR_EACH (StringVectCIter, i, rootDirs->names) { const std::string dir = pathJoin("locale", *i); @@ -110,7 +110,7 @@ void Files::copyVirtFsDir(const std::string &restrict inDir, const std::string &restrict outDir) { mkdir_r(outDir.c_str()); - VirtFs::VirtList *const files = VirtFs::enumerateFiles(inDir); + VirtFs::List *const files = VirtFs::enumerateFiles(inDir); FOR_EACH (StringVectCIter, i, files->names) { const std::string file = pathJoin(inDir, *i); diff --git a/src/fs/virtfs/fs.cpp b/src/fs/virtfs/fs.cpp index c4f1e7f42..4d73784dd 100644 --- a/src/fs/virtfs/fs.cpp +++ b/src/fs/virtfs/fs.cpp @@ -28,7 +28,7 @@ #include "fs/virtfs/fsdir.h" #include "fs/virtfs/fsfuncs.h" #include "fs/virtfs/fszip.h" -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #include "fs/virtfs/virtzipentry.h" #include "fs/virtfs/zipreader.h" @@ -136,9 +136,9 @@ namespace VirtFs return false; } - VirtList *enumerateFiles(std::string dirName) + List *enumerateFiles(std::string dirName) { - VirtList *const list = new VirtList; + List *const list = new List; prepareFsPath(dirName); if (checkPath(dirName) == false) { @@ -258,7 +258,7 @@ namespace VirtFs return FsDir::isSymbolicLink(name); } - void freeList(VirtList *restrict const handle) + void freeList(List *restrict const handle) { delete handle; } diff --git a/src/fs/virtfs/fs.h b/src/fs/virtfs/fs.h index 8b5df99ef..a6b787d6e 100644 --- a/src/fs/virtfs/fs.h +++ b/src/fs/virtfs/fs.h @@ -33,7 +33,7 @@ namespace VirtFs { struct File; struct FsEntry; - struct VirtList; + struct List; void init(const std::string &restrict name); void updateDirSeparator(); @@ -41,10 +41,10 @@ namespace VirtFs const char *getBaseDir(); const char *getUserDir(); bool exists(std::string name); - VirtList *enumerateFiles(std::string dir) RETURNS_NONNULL; + List *enumerateFiles(std::string dir) RETURNS_NONNULL; bool isDirectory(std::string name); bool isSymbolicLink(const std::string &restrict name); - void freeList(VirtList *restrict const handle); + void freeList(List *restrict const handle); File *openRead(std::string filename); File *openWrite(std::string filename); File *openAppend(std::string filename); diff --git a/src/fs/virtfs/fsdir.cpp b/src/fs/virtfs/fsdir.cpp index f6642fb14..4ee6d648e 100644 --- a/src/fs/virtfs/fsdir.cpp +++ b/src/fs/virtfs/fsdir.cpp @@ -28,7 +28,7 @@ #include "fs/virtfs/file.h" #include "fs/virtfs/fsdirrwops.h" #include "fs/virtfs/fsfuncs.h" -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #include "utils/checkutils.h" #include "utils/stringutils.h" @@ -266,7 +266,7 @@ namespace FsDir #endif // WIN32 } - void freeList(VirtList *restrict const handle) + void freeList(List *restrict const handle) { delete handle; } diff --git a/src/fs/virtfs/fsdir.h b/src/fs/virtfs/fsdir.h index 1abb46211..e57036043 100644 --- a/src/fs/virtfs/fsdir.h +++ b/src/fs/virtfs/fsdir.h @@ -33,7 +33,7 @@ namespace VirtFs struct File; struct FsEntry; struct FsFuncs; -struct VirtList; +struct List; namespace FsDir { @@ -71,7 +71,7 @@ namespace FsDir const std::string &dirName, bool &isDirFlag); bool isSymbolicLink(std::string name); - void freeList(VirtList *restrict const handle); + void freeList(List *restrict const handle); bool setWriteDir(std::string newDir); bool getRealDir(FsEntry *restrict const entry, const std::string &filename, diff --git a/src/fs/virtfs/fszip.cpp b/src/fs/virtfs/fszip.cpp index b114d4740..c3e51cf45 100644 --- a/src/fs/virtfs/fszip.cpp +++ b/src/fs/virtfs/fszip.cpp @@ -23,7 +23,7 @@ #include "fs/virtfs/file.h" #include "fs/virtfs/fsfuncs.h" #include "fs/virtfs/fsziprwops.h" -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #include "fs/virtfs/virtzipentry.h" #include "fs/virtfs/zipreader.h" #include "fs/virtfs/ziplocalheader.h" @@ -502,7 +502,7 @@ namespace FsZip return false; } - void freeList(VirtList *restrict const handle) + void freeList(List *restrict const handle) { delete handle; } diff --git a/src/fs/virtfs/fszip.h b/src/fs/virtfs/fszip.h index 03981f0ec..4caffba17 100644 --- a/src/fs/virtfs/fszip.h +++ b/src/fs/virtfs/fszip.h @@ -29,7 +29,7 @@ namespace VirtFs { struct File; -struct VirtList; +struct List; struct FsFuncs; struct FsEntry; @@ -57,7 +57,7 @@ namespace FsZip bool isDirectory(FsEntry *restrict const entry, const std::string &dirName, bool &isDirFlag); - void freeList(VirtList *restrict const handle); + void freeList(List *restrict const handle); File *openRead(FsEntry *restrict const entry, const std::string &filename); File *openWrite(FsEntry *restrict const entry, diff --git a/src/fs/virtfs/virtlist.cpp b/src/fs/virtfs/list.cpp index 332968d09..2f0a23d66 100644 --- a/src/fs/virtfs/virtlist.cpp +++ b/src/fs/virtfs/list.cpp @@ -18,19 +18,19 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #include "debug.h" namespace VirtFs { -VirtList::VirtList() : +List::List() : names() { } -VirtList::~VirtList() +List::~List() { } diff --git a/src/fs/virtfs/virtlist.h b/src/fs/virtfs/list.h index 7f698e6ad..9dcb9e269 100644 --- a/src/fs/virtfs/virtlist.h +++ b/src/fs/virtfs/list.h @@ -28,13 +28,13 @@ namespace VirtFs { -struct VirtList final +struct List final { - VirtList(); + List(); - A_DELETE_COPY(VirtList) + A_DELETE_COPY(List) - ~VirtList(); + ~List(); StringVect names; }; diff --git a/src/fs/virtfs/tools.cpp b/src/fs/virtfs/tools.cpp index ea897e861..a5bf06097 100644 --- a/src/fs/virtfs/tools.cpp +++ b/src/fs/virtfs/tools.cpp @@ -25,7 +25,7 @@ #include "fs/paths.h" #include "fs/virtfs/fs.h" -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #include "utils/stringutils.h" @@ -40,7 +40,7 @@ namespace VirtFs const std::string &restrict ext, const Append append) { - VirtList *const list = VirtFs::enumerateFiles(path); + List *const list = VirtFs::enumerateFiles(path); FOR_EACH (StringVectCIter, i, list->names) { const std::string str = *i; @@ -60,7 +60,7 @@ namespace VirtFs void searchAndRemoveArchives(const std::string &restrict path, const std::string &restrict ext) { - VirtList *const list = VirtFs::enumerateFiles(path); + List *const list = VirtFs::enumerateFiles(path); FOR_EACH (StringVectCIter, i, list->names) { const std::string str = *i; diff --git a/src/fs/virtfs/virtfs1_unittest.cc b/src/fs/virtfs/virtfs1_unittest.cc index b1084d605..8a219e3ce 100644 --- a/src/fs/virtfs/virtfs1_unittest.cc +++ b/src/fs/virtfs/virtfs1_unittest.cc @@ -25,7 +25,7 @@ #include "fs/virtfs/direntry.h" #include "fs/virtfs/fs.h" #include "fs/virtfs/rwops.h" -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #include "utils/checkutils.h" #include "utils/delete2.h" @@ -673,7 +673,7 @@ TEST_CASE("VirtFs1 getRealDir2") delete2(logger); } -static bool inList(const VirtFs::VirtList *const list, +static bool inList(const VirtFs::List *const list, const std::string &name) { FOR_EACH (StringVectCIter, it, list->names) @@ -718,7 +718,7 @@ TEST_CASE("VirtFs1 enumerateFiles1") VirtFs::mountDirSilent("../data", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; const int cnt1 = VirtFs::exists("test/test2.txt") ? 28 : 27; const int cnt2 = 28; @@ -763,7 +763,7 @@ TEST_CASE("VirtFs1 enumerateFiles2") VirtFs::mountDirSilent("../data/test/dir1", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("/"); REQUIRE(list->names.size() == 5); @@ -788,7 +788,7 @@ TEST_CASE("VirtFs1 enumerateFiles3") VirtFs::mountDirSilent("../data/test/dir2", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("/"); const size_t sz = list->names.size(); @@ -811,7 +811,7 @@ TEST_CASE("VirtFsZip enumerateFiles4") VirtFs::mountZip(prefix + "test.zip", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("dir"); REQUIRE(list->names.size() == 2); @@ -838,7 +838,7 @@ TEST_CASE("VirtFsZip enumerateFiles5") VirtFs::mountZip(prefix + "test2.zip", Append_true); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("dir"); FOR_EACH (StringVectCIter, it, list->names) @@ -872,7 +872,7 @@ TEST_CASE("VirtFsZip enumerateFiles6") VirtFs::mountZip(prefix + "test.zip", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("/"); REQUIRE(list->names.size() == 1); @@ -896,7 +896,7 @@ TEST_CASE("VirtFsZip enumerateFiles7") VirtFs::mountZip(prefix + "test2.zip", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("/"); REQUIRE(list->names.size() == 4); @@ -925,7 +925,7 @@ TEST_CASE("VirtFsZip enumerateFiles8") VirtFs::mountDirSilent(prefix + "data/test", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("dir2"); REQUIRE(list->names.size() >= 6); @@ -957,7 +957,7 @@ TEST_CASE("VirtFsZip enumerateFiles9") VirtFs::mountDirSilent(prefix + "data/test", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("dir"); REQUIRE(list->names.size() == 4); diff --git a/src/fs/virtfs/virtfs_unittest.cc b/src/fs/virtfs/virtfs_unittest.cc index 3c0b65679..8c7688cb6 100644 --- a/src/fs/virtfs/virtfs_unittest.cc +++ b/src/fs/virtfs/virtfs_unittest.cc @@ -24,7 +24,7 @@ #include "fs/paths.h" #include "fs/virtfs/fs.h" -#include "fs/virtfs/virtlist.h" +#include "fs/virtfs/list.h" #include "utils/checkutils.h" #include "utils/delete2.h" @@ -216,7 +216,7 @@ static void removeTemp(StringVect &restrict list) } } -static bool inList(const VirtFs::VirtList *const list, +static bool inList(const VirtFs::List *const list, const std::string &name) { FOR_EACH (StringVectCIter, it, list->names) @@ -234,7 +234,7 @@ TEST_CASE("VirtFs enumerateFiles1") VirtFs::mountDirSilent("data", Append_false); VirtFs::mountDirSilent("../data", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; const int cnt1 = VirtFs::exists("test/test2.txt") ? 28 : 27; const int cnt2 = 28; @@ -277,7 +277,7 @@ TEST_CASE("VirtFs enumerateFiles2") VirtFs::mountDirSilent("../data/test/dir1", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("/"); REQUIRE(list->names.size() == 5); @@ -299,7 +299,7 @@ TEST_CASE("VirtFs enumerateFiles3") VirtFs::mountZip(prefix + "data/test/test.zip", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("/"); REQUIRE(list->names.size() == 1); @@ -321,7 +321,7 @@ TEST_CASE("VirtFs enumerateFiles4") VirtFs::mountZip(prefix + "data/test/test2.zip", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("/"); REQUIRE(list->names.size() == 4); @@ -347,7 +347,7 @@ TEST_CASE("VirtFs enumerateFiles5") Append_false); VirtFs::mountDirSilent(prefix + "data/test", Append_false); - VirtFs::VirtList *list = nullptr; + VirtFs::List *list = nullptr; list = VirtFs::enumerateFiles("dir2"); REQUIRE(inList(list, "file1.txt")); |