diff options
| author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-03-10 12:39:04 +0500 |
|---|---|---|
| committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-03-10 12:48:59 +0500 |
| commit | 4a13df61b92b8bf673f8a71d5fa0abf0356a4899 (patch) | |
| tree | 071a3830ce0f2309e40a4bb16b7dd42018bd852f /include/winapi/file.hpp | |
| parent | Makefile: remove stupid header, etc. (diff) | |
| download | winapi-common-4a13df61b92b8bf673f8a71d5fa0abf0356a4899.tar.gz winapi-common-4a13df61b92b8bf673f8a71d5fa0abf0356a4899.zip | |
add Doxygen docs
Diffstat (limited to 'include/winapi/file.hpp')
| -rw-r--r-- | include/winapi/file.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/winapi/file.hpp b/include/winapi/file.hpp index 7d0126c..b1c8ce3 100644 --- a/include/winapi/file.hpp +++ b/include/winapi/file.hpp @@ -21,6 +21,11 @@ namespace winapi { bool operator==(const FILE_ID_128& a, const FILE_ID_128& b); +/** + * @brief File I/O. + * + * Easily open, read & write files. + */ class File : public Handle { public: struct ID { @@ -32,20 +37,37 @@ public: } }; + /** Open file for reading. */ static File open_r(const std::string&); + /** @overload */ static File open_r(const CanonicalPath&); + /** Open file for reading (inc. ability to read its attributes). */ static File open_read_attributes(const std::string&); + /** @overload */ static File open_read_attributes(const CanonicalPath&); + /** Open file for writing. */ static File open_w(const std::string&); + /** @overload */ static File open_w(const CanonicalPath&); + /** Delete a file. */ static void remove(const std::string&); + /** @overload */ static void remove(const CanonicalPath&); + /** Make a File instance from an open handle. */ explicit File(Handle&& handle) : Handle{std::move(handle)} {} + /** + * Get file size. + * @return File size, bytes. + */ std::size_t get_size() const; + /** + * Get file ID. + * File ID is a unique representation of a file, suitable for hashing. + */ ID query_id() const; }; |
