18 #include "lfilesystem/lfilesystem_Export.h"
74 explicit CFile (std::FILE* fileHandle) noexcept;
103 [[nodiscard]] std::FILE* get() const noexcept;
106 std::FILE* operator->() const noexcept;
111 std::FILE& operator*() const;
116 [[nodiscard]]
Path getPath() const;
119 operator std::FILE*() const noexcept;
127 void close() noexcept;
134 bool open (const
Path& filepath,
Mode mode) noexcept;
137 [[nodiscard]]
bool isOpen() const noexcept;
140 explicit operator
bool() const noexcept;
146 [[nodiscard]]
File getFile() const;
156 [[nodiscard]] static
CFile createTempFile();
159 std::FILE* ptr {
nullptr };
This class is a wrapper around a C-style FILE* that takes care of freeing the file when the object is...
CFile(CFile &&other) noexcept
Move constructor.
CFile(const Path &filepath, Mode mode) noexcept
Creates a CFile referencing the given filepath, in the given mode.
CFile()=default
Creates a default CFile that holds a nullptr.
Mode
Represents possible modes a file can be opened in.
~CFile() noexcept
Destructor.
CFile(std::FILE *fileHandle) noexcept
Creates a CFile that takes ownership of the passed FILE* .
This class represents a file on the filesystem.
std::filesystem::path Path
Convenience typedef for filesystem paths.
This file defines the FilesystemEntry class.