1 #ifndef LIBFILEZILLA_FILE_HEADER
2 #define LIBFILEZILLA_FILE_HEADER
7 #include "glue/windows.hpp"
25 class FZ_PUBLIC_SYMBOL
file final
53 current_user_only = 0x4,
65 current_user_and_admins_only = 0x8
74 file& operator=(
file const&) =
delete;
77 file& operator=(
file && op) noexcept;
80 explicit operator
bool()
const {
return opened(); }
82 bool open(
native_string const& f, mode m, creation_flags d = existing);
101 int64_t size()
const;
115 int64_t seek(int64_t offset, seek_mode m);
140 int64_t
read(
void *buf, int64_t count);
152 int64_t
write(
void const* buf, int64_t count);
163 HANDLE hFile_{INVALID_HANDLE_VALUE};
mode
Files can be opened for reading or writing, but not both.
Definition: file.hpp:29
Seek from current position in the file.
Definition: file.hpp:92
int64_t position()
Get Current position in file.
Definition: file.hpp:118
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
Seek from beginning of file.
Definition: file.hpp:89
bool remove_file(native_string const &name)
remove the specified file.
The namespace used by libfilezilla.
Definition: apply.hpp:17
seek_mode
Used by seek.
Definition: file.hpp:87
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.