MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Types | Public Member Functions
FileOutputStream Class Referencefinal

`#include <FileOutputStream.hxx>`

Inheritance diagram for FileOutputStream:
[legend]
Collaboration diagram for FileOutputStream:
[legend]

## Public Types
enum | Mode : uint8_t { Mode::CREATE, Mode::CREATE_VISIBLE, Mode::APPEND_EXISTING, Mode::APPEND_OR_CREATE }

## Public Member Functions
| FileOutputStream (Path _path, Mode _mode=Mode::CREATE)
| ~FileOutputStream ()
Path | GetPath () const
gcc_pure uint64_t | Tell () const
void | Write (const void *data, size_t size) override
| Throws std::exception on error. More...
void | Commit ()
void | Cancel ()
Public Member Functions inherited from OutputStream
| OutputStream ()=default
| OutputStream (const OutputStream &)=delete

## Detailed Description

Definition at line 41 of file FileOutputStream.hxx.

## Member Enumeration Documentation

enum FileOutputStream::Mode : uint8_t
| strong

Enumerator
CREATE | Create a new file, or replace an existing file. File contents may not be visible until Commit() has been called.
CREATE_VISIBLE | Like #CREATE, but no attempt is made to hide file contents during the transaction (e.g. via O_TMPFILE or a hidden temporary file).
APPEND_EXISTING | Append to a file that already exists. If it does not, an exception is thrown.
APPEND_OR_CREATE | Like #APPEND_EXISTING, but create the file if it does not exist.

Definition at line 59 of file FileOutputStream.hxx.

## Constructor & Destructor Documentation

FileOutputStream::FileOutputStream | ( | Path | _path,
|  | Mode | _mode = `Mode::CREATE`
| ) |  |
| explicit

FileOutputStream::~FileOutputStream | ( |  | ) |
| inline

Definition at line 93 of file FileOutputStream.hxx.

## Member Function Documentation

void FileOutputStream::Cancel | ( |  | ) |

void FileOutputStream::Commit | ( |  | ) |

Path FileOutputStream::GetPath | ( |  | ) | const
| inline

Definition at line 99 of file FileOutputStream.hxx.

gcc_pure uint64_t FileOutputStream::Tell | ( |  | ) | const

void FileOutputStream::Write | ( | const void * | data,
|  | size_t | size
| ) |  |
| override virtual

Throws std::exception on error.

Implements OutputStream.

The documentation for this class was generated from the following file:

- fs/io/FileOutputStream.hxx