Base Framework
|
#include <base/io/FileOutputStream.h>
Inherits Object, and OutputStream.
Public Types | |
enum | Options { CREATE = File::CREATE, TRUNCATE = File::TRUNCATE, EXCLUSIVE = File::EXCLUSIVE, ASYNCHRONOUS = File::ASYNCHRONOUS, APPEND = File::APPEND } |
enum | Permissions { RWXU = 0x700, RUSR = 0x400, WUSR = 0x200, XUSR = 0x100, RWXG = 0x70, RGRP = 0x40, WGRP = 0x20, XGRP = 0x10, RWXO = 0x7, ROTH = 0x4, WOTH = 0x2, XOTH = 0x1 } |
Public Member Functions | |
FileOutputStream (const String &path, unsigned int options=CREATE|TRUNCATE, unsigned int permissions=0x640) | |
FileOutputStream (const FileOutputStream ©) noexcept | |
bool | open (const String &path, unsigned int options=CREATE|TRUNCATE, unsigned int permissions=0x640) |
FileOutputStream & | operator= (const FileOutputStream &assign) noexcept |
bool | isOpen () const noexcept |
void | close () |
void | flush () |
unsigned int | write (const uint8 *buffer, unsigned int count, bool nonblocking=false) |
![]() | |
virtual | ~Stream () noexcept(false) |
![]() | |
ReferenceCountedObject () noexcept | |
ReferenceCountedObject (const ReferenceCountedObject ©) noexcept | |
ReferenceCountedObject (ReferenceCountedObject &&move) noexcept | |
ReferenceCountedObject & | operator= (const ReferenceCountedObject ©) noexcept |
ReferenceCountedObject & | operator= (ReferenceCountedObject &&move) noexcept |
MemorySize | getNumberOfReferences_INTERNAL () const noexcept |
virtual bool | useGarbageCollector () const noexcept |
![]() | |
DynamicObject () noexcept | |
bool | isValidObject () const noexcept |
virtual | ~DynamicObject () noexcept(false) |
_COM_AZURE_DEV__BASE__OVERRIDE_ALLOC () | |
File initialization flags.
Permissions.
FileOutputStream::FileOutputStream | ( | const String & | path, |
unsigned int | options = CREATE|TRUNCATE , |
||
unsigned int | permissions = 0x640 |
||
) |
Initializes the file output stream.
path | The name of the file. |
options | The flags used to open the file (CREATE, TRUNCATE, APPEND, NONBLOCK, and SYNC). |
permissions | Specifies the permissions to be used if the file is created. |
|
virtual |
Closes the stream and releases any system resources associated with the stream.
Implements Stream.
|
inlinevirtual |
Forces any buffered bytes to be written out.
Implements OutputStream.
|
noexcept |
Returns true if open.
bool FileOutputStream::open | ( | const String & | path, |
unsigned int | options = CREATE|TRUNCATE , |
||
unsigned int | permissions = 0x640 |
||
) |
Open the file output stream.
path | The name of the file. |
options | The flags used to open the file (CREATE, TRUNCATE, APPEND, NONBLOCK, and SYNC). |
permissions | Specifies the permissions to be used if the file is created. |
|
inlinevirtual |
Writes the specified number of bytes in the buffer to the stream. In blocking mode the method does not return until all bytes have been written. In non-blocking mode the total number of bytes written may be any number below or equal to the requested number of bytes.
buffer | The buffer containing the bytes to be written. |
size | The number of bytes to be written. |
nonblocking | Specifies that the method may not block. |
Implements OutputStream.