File
AppCUI::OS::File (class)
-
class File : public AppCUI::OS::DataObject
Public Functions
-
File()
-
~File()
-
bool OpenWrite(const std::filesystem::path &filePath)
Opens a file for Read/Write.
The file MUST exists. The file pointer will be set at the end of the file.
- Parameters:
filePath – [in] is the full path to an existing file.
-
bool OpenRead(const std::filesystem::path &filePath)
Opens a file for Read.
The file MUST exists. The file pointer will be set at the begining of the file.
- Parameters:
filePath – [in] is the full path to an existing file.
-
bool Create(const std::filesystem::path &filePath, bool overwriteExisting = true)
Creates a new file.
If the file exists and overwriteExisting parameter is set to true, it will be overwritten.
- Parameters:
filePath – [in] is the full path to an existing file.
overwriteExisting – [in] - if set to true and the file exists it will overwrite the file. If set to false and a file exists, will fail to overwrite and the method will return false.
-
virtual void Close() override
Public Static Functions
-
static bool WriteContent(const std::filesystem::path &path, Utils::BufferView buf)
-
static bool WriteContent(const std::filesystem::path &path, string_view text)
-
File()