mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-11 02:36:33 +08:00
Updated readme.
This commit is contained in:
parent
90bab0edee
commit
217fb2bdf5
@ -100,7 +100,7 @@ If you want to also use the `fstream` wrapper with `path` support as fallback,
|
|||||||
you might use:
|
you might use:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#if defined(__has_include) && __has_include(<filesystem>)
|
#if defined(__cplusplus) && __cplusplus >= 201703L && defined(__has_include) && __has_include(<filesystem>)
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
namespace fs {
|
namespace fs {
|
||||||
using namespace std::filesystem;
|
using namespace std::filesystem;
|
||||||
@ -119,6 +119,9 @@ using fstream = ghc::filesystem::fstream;
|
|||||||
#endif
|
#endif
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Now you have e.g. `fs::ofstream out(somePath);` and it is either the wrapper or
|
||||||
|
the C++17 `std::ofstream`.
|
||||||
|
|
||||||
Be aware, as a header-only library, it is not hiding the fact, that it
|
Be aware, as a header-only library, it is not hiding the fact, that it
|
||||||
uses system includes, so they "pollute" your global namespace.
|
uses system includes, so they "pollute" your global namespace.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user