16 #ifndef INCLUDE_NN_NLIB_FILEOUTPUTSTREAM_H_ 17 #define INCLUDE_NN_NLIB_FILEOUTPUTSTREAM_H_ 31 buffer_size(buffer_size_) {}
39 is_internal_buffer_(false) {}
44 return this->Init(settings);
49 return Open(filename, flags, 0644);
57 return Open(filename, flags, 0644);
75 bool is_internal_buffer_;
81 #endif // INCLUDE_NN_NLIB_FILEOUTPUTSTREAM_H_ constexpr FileOutputStreamSettings() noexcept
Instantiates the object with default parameters (default constructor). The setting to allocate the Fi...
#define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
The structure that stores information about the file stream settings.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
The class for file output streams.
void * buf
The pointer to the buffer used by FileOutputStream. The default is NULL.
errno_t Open(const wchar_t *filename) noexcept
A parameter omitted version of the above function. Assigns NLIB_FD_O_WRONLY | NLIB_FD_O_CREAT | NLIB_...
nlib_fd GetFd() const noexcept
Returns the file descriptor.
size_t buffer_size
The size of the buffer used by FileOutputStream. The default is 4096.
errno_t Open(const wchar_t *filename, int flags) noexcept
A parameter omitted version of the above function. Assigns 0644 to mode.
errno_t Open(const char *filename, int flags) noexcept
A parameter omitted version of the above function. Assigns 0644 to mode.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
constexpr FileOutputStream() noexcept
Instantiates the object with default parameters (default constructor). Requires initialization with I...
constexpr FileOutputStreamSettings(void *buf_, size_t buffer_size_) noexcept
Sets the individual data members.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
errno_t Open(const char *filename) noexcept
A parameter omitted version of the above function. Assigns NLIB_FD_O_WRONLY | NLIB_FD_O_CREAT | NLIB_...
Defines the base class for output streams.
The base class for output streams. This class cannot be instantiated.