16 #ifndef INCLUDE_NN_NLIB_FILEOUTPUTSTREAM_H_ 17 #define INCLUDE_NN_NLIB_FILEOUTPUTSTREAM_H_ 31 buffer_size(buffer_size_) {}
39 is_internal_buffer_(false) {}
43 return this->Init(settings);
52 return Open(filename, flags, 0644);
57 return Open(filename, flags, 0644);
66 virtual bool PushBuffer_(
const void* p,
size_t nbytes,
69 virtual bool WriteGather_(
const nlib_fd_iovec* iov,
int iovcnt) NLIB_NOEXCEPT
NLIB_OVERRIDE;
75 bool is_internal_buffer_;
81 #endif // INCLUDE_NN_NLIB_FILEOUTPUTSTREAM_H_ constexpr FileOutputStreamSettings() noexcept
Instantiates the object with default parameters (default constructor). Sets the default values...
#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
A pointer to a buffer.
nlib_fd GetFd() const noexcept
Returns the file descriptor.
size_t buffer_size
The size of the buffer.
errno_t Init() noexcept
Initializes the stream with the default settings.
#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.
FileOutputStream() noexcept
Instantiates the object with default parameters (default constructor). The buffer must be set and ini...
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.
Defines the base class for output streams.
The base class for output streams. This class cannot be instantiated.