nn::fs::FileOutputStream Classclass FileOutputStream :
private nn::fs::IOutputStream,
private nn::fs::detail::FileBase,
private nn::util::NonCopyable< FileOutputStream >
Class for writing to files.
Open a file specified by a path name and write data to it.
To improve the efficiency of writing to files, if the TryWrite or Write functions are called with flush = false, physical storage itself will not actually be written. Instead, write data will temporarily be saved in a buffer managed by the system. To actually write to physical storage (flush the buffer), call these write functions with flush = true. Then, either indicate that the buffer should be flushed after data is written or explicitly flush it by calling TryFlush. If a file is closed by executing the Finalize function or a destructor, without flushing this buffer, programs will stop if using other than Release version libraries. Plans call for changing this in the next SDK, so that programs will stop even in the case of Release versions.
If writing the same file consecutively more than once, after writing is finished using flush = false for efficiency, be sure to finally call TryFlush.
You can specify path names using both wide strings and multibyte strings. If you specify a multibyte string, a buffer for conversion to wide characters will be allocated on the stack. Be careful with conversions to wide characters, though, because they are not thread-safe. You should use a wide string unless you have a specific reason not to.
This class cannot be used to create new files in expanded save data. For that, use a TryCreateFile function that specifies the size.
FileOutputStream
|
Constructor. | |
|---|---|---|
Initialize
|
Opens the specified file. | |
TryInitialize
|
Opens the specified file. | |
Finalize
|
Closes a file. | |
| V |
~FileOutputStream
|
Destructor. |
| V |
Write
|
Writes the specified amount of data from a buffer to a file. |
| V |
TryWrite
|
Writes the specified amount of data from a buffer to a file. |
| V |
Seek
|
Changes the access position in the file. |
| V |
TrySeek
|
Changes the access position in the file. |
| V |
GetPosition
|
Gets the current write position relative to the start of the file. |
| V |
TryGetPosition
|
Gets the current write position relative to the start of the file. |
| V |
SetPosition
|
Sets the current write position relative to the start of the file. |
| V |
TrySetPosition
|
Sets the current write position relative to the start of the file. |
| V |
GetSize
|
Gets the file size. |
| V |
TryGetSize
|
Gets the file size. |
| V |
SetSize
|
Sets the file size. |
| V |
TrySetSize
|
Sets the file size. |
| V |
Flush
|
Writes the file cache back to the device. |
| V |
TryFlush
|
Writes the file cache back to the device. |
SetPriority
|
Sets a stream's access priority. | |
TrySetPriority
|
Sets a stream's access priority. |
nn::fs::IPositionable
nn::fs::IOutputStream
nn::fs::FileOutputStream
CONFIDENTIAL