diff options
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/include/zencore/filesystem.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/zencore/include/zencore/filesystem.h b/src/zencore/include/zencore/filesystem.h index e3eafb875..f28863679 100644 --- a/src/zencore/include/zencore/filesystem.h +++ b/src/zencore/include/zencore/filesystem.h @@ -8,8 +8,14 @@ #include <zencore/iobuffer.h> #include <zencore/string.h> +ZEN_THIRD_PARTY_INCLUDES_START #include <filesystem> #include <functional> +ZEN_THIRD_PARTY_INCLUDES_END + +#if ZEN_PLATFORM_WINDOWS +# undef CopyFile +#endif namespace zen { @@ -28,7 +34,7 @@ bool DeleteDirectories(const std::filesystem::path& Path, std::error_code& Ec); /** Ensure directory exists. - Will also create any required parent direCleanDirectoryctories + Will also create any required parent directories */ bool CreateDirectories(const std::filesystem::path& Path); @@ -149,8 +155,15 @@ struct FileContents std::error_code ErrorCode; IoBuffer Flatten(); + + explicit operator bool() const { return !ErrorCode; } }; +/** Read all of standard input into a FileContents structure + * + * Note that this will block until end-of-file is reached on standard input + * which could be a very bad idea in some contexts. + */ FileContents ReadStdIn(); /** Prepare file for reading |