diff options
| author | Stefan Boberg <[email protected]> | 2026-01-19 15:47:59 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-01-19 15:47:59 +0100 |
| commit | 975babca65c6e118db268c6335a4ecbf7c2a9744 (patch) | |
| tree | 08c9ad8a58a7a2393ab10b26666d5fd29d44bd63 /src/zencore/include | |
| parent | ZenServerProcess API changes (#719) (diff) | |
| download | zen-975babca65c6e118db268c6335a4ecbf7c2a9744.tar.xz zen-975babca65c6e118db268c6335a4ecbf7c2a9744.zip | |
zenserver API changes, some other minor changes (#720)
* add system metrics output to top command
* removed unnecessary xmake directives
* file system API/comment tweaks
* fixed out-of-range access in httpserver test
* updated ZenServer base API to allow customization by mode
Diffstat (limited to 'src/zencore/include')
| -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 |