1 #ifndef LIBFILEZILLA_FILE_HEADER 2 #define LIBFILEZILLA_FILE_HEADER 7 #include "private/windows.hpp" 25 class FZ_PUBLIC_SYMBOL
file final
54 file& operator=(
file const&) =
delete;
58 bool open(
native_string const& f, mode m, creation_flags d = existing);
91 int64_t seek(int64_t offset, seek_mode m);
94 int64_t
position() {
return seek(0, current); }
116 int64_t read(
void *buf, int64_t count);
128 int64_t write(
void const* buf, int64_t count);
139 HANDLE hFile_{INVALID_HANDLE_VALUE};
145 bool FZ_PUBLIC_SYMBOL remove_file(
native_string const& name);
mode
Files can be opened for reading or writing, but not both.
Definition: file.hpp:29
Keep existing data if file exists, otherwise create new.
Definition: file.hpp:42
Seek from current position in the file.
Definition: file.hpp:68
int64_t position()
Get Current position in file.
Definition: file.hpp:94
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition: string.hpp:32
Seek from beginning of file.
Definition: file.hpp:65
The namespace used by libfilezilla.
Definition: apply.hpp:16
seek_mode
Used by seek.
Definition: file.hpp:63
creation_flags
Creation flags when opening file for writing.
Definition: file.hpp:40
Lean class for file access.
Definition: file.hpp:25
Sets some global macros and further includes string.hpp.