20 #ifndef MPD_FILE_OUTPUT_STREAM_HXX 21 #define MPD_FILE_OUTPUT_STREAM_HXX 45 HANDLE handle = INVALID_HANDLE_VALUE;
55 bool is_tmpfile =
false;
59 enum class Mode : uint8_t {
104 uint64_t
Tell() const noexcept;
107 void Write(const
void *data,
size_t size) override;
113 void OpenCreate(
bool visible);
114 void OpenAppend(
bool create);
121 handle = INVALID_HANDLE_VALUE;
130 return SetFilePointer(handle, 0,
nullptr,
131 FILE_END) != 0xffffffff;
135 bool IsDefined()
const {
137 return handle != INVALID_HANDLE_VALUE;
Create a new file, or replace an existing file.
FileOutputStream(Path _path, Mode _mode=Mode::CREATE)
Like #APPEND_EXISTING, but create the file if it does not exist.
A path name in the native file system character set.
bool Close() noexcept
Close the file descriptor.
Like #CREATE, but no attempt is made to hide file contents during the transaction (e...
gcc_pure uint64_t Tell() const noexcept
Append to a file that already exists.
A path name in the native file system character set.
constexpr bool IsDefined() const
static constexpr FileDescriptor Undefined()
void Write(const void *data, size_t size) override
Throws std::exception on error.
An OO wrapper for a UNIX file descriptor.