1 #ifndef LIBFILEZILLA_FILE_HEADER
2 #define LIBFILEZILLA_FILE_HEADER
7 #include "private/windows.hpp"
25 class FZ_PUBLIC_SYMBOL
file final
53 current_user_only = 0x4
62 file& operator=(
file const&) =
delete;
66 bool open(
native_string const& f, mode m, creation_flags d = existing);
124 int64_t
read(
void *buf, int64_t count);
136 int64_t
write(
void const* buf, int64_t count);
147 HANDLE hFile_{INVALID_HANDLE_VALUE};
Lean class for file access.
Definition: file.hpp:26
mode
Files can be opened for reading or writing, but not both.
Definition: file.hpp:29
creation_flags
Creation flags when opening file for writing.
Definition: file.hpp:40
int64_t seek(int64_t offset, seek_mode m)
Relative seek based on seek mode.
int64_t write(void const *buf, int64_t count)
Write data to file.
int64_t read(void *buf, int64_t count)
Read data from file.
bool truncate()
Truncate the file to the current position of the file pointer.
int64_t size() const
Gets size of file.
seek_mode
Used by seek.
Definition: file.hpp:71
@ begin
Seek from beginning of file.
Definition: file.hpp:73
@ current
Seek from current position in the file.
Definition: file.hpp:76
int64_t position()
Get Current position in file.
Definition: file.hpp:102
bool fsync()
Ensure data is flushed to disk.
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition: apply.hpp:17
bool remove_file(native_string const &name)
remove the specified file.
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition: string.hpp:33