forked from vmangos/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request vmangos#2746 from 0blu/native-some-std-filesystem
Native Branch: Replace parts of `IO::Filesystem` with C++17 `std::filesystem`
- Loading branch information
Showing
16 changed files
with
6,469 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "FileSystem.h" | ||
|
||
#include "nonstd/filesystem.h" | ||
|
||
std::string IO::Filesystem::ToAbsolutePath(std::string const& partialPath) | ||
{ | ||
return nonstd::filesystem::absolute(partialPath).string(); | ||
} | ||
|
||
std::vector<std::string> IO::Filesystem::GetAllFilesInFolder(std::string const& folderPath, IO::Filesystem::OutputFilePath filePathOption) | ||
{ | ||
std::vector<std::string> files; | ||
for (const auto& entry : nonstd::filesystem::directory_iterator(folderPath, ghc::filesystem::directory_options::none)) | ||
{ | ||
if (!entry.is_regular_file()) | ||
continue; | ||
|
||
std::string filePath = filePathOption == OutputFilePath::FullFilePath ? entry.path().string() : entry.path().filename().string(); | ||
files.push_back(filePath); | ||
} | ||
return files; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef NONSTD_FILESYSTEM_BACKPORT_H | ||
#define NONSTD_FILESYSTEM_BACKPORT_H | ||
|
||
#include "./ghc-filesystem-cpp11-backport/filesystem.hpp" | ||
|
||
namespace nonstd { namespace filesystem { | ||
using namespace ghc::filesystem; | ||
using ifstream = ghc::filesystem::ifstream; | ||
using ofstream = ghc::filesystem::ofstream; | ||
using fstream = ghc::filesystem::fstream; | ||
}} // namespace nonstd::filesystem | ||
|
||
#endif // NONSTD_FILESYSTEM_BACKPORT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2018, Steffen Schümann <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# gulrak/filesystem | ||
|
||
> An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD. | ||
It is used in MaNGOS to allow for an easy filesystem interface without writing everything by ourselves and each OS. | ||
It aims to be a drop-in-replacement for the official standard, which means if this project upgrades to a newer C++ version, it can be easily exchanged. | ||
|
||
## Source | ||
Commit: https://github.com/gulrak/filesystem/commit/b1982f06c84f08a99fb90bac43c2d03712efe921 | ||
Date: 2024-04-27T10:20:18Z | ||
|
||
## Copied files | ||
``` | ||
include/* | ||
LICENSE.txt | ||
``` |
Oops, something went wrong.