16 #ifndef INCLUDE_NN_NLIB_OUTPUTCONVERTERSTREAM_H_ 17 #define INCLUDE_NN_NLIB_OUTPUTCONVERTERSTREAM_H_ 26 virtual ~OutputTransform() {}
27 virtual errno_t Transform(OutputStream* os,
const void* p,
size_t nBytes,
bool doFlush) = 0;
31 virtual void* GetWorkBuffer(
size_t* n) = 0;
34 virtual errno_t OnSetStream(OutputStream* os) = 0;
37 virtual errno_t OnClose(OutputStream* os) = 0;
43 : stream_(
nullptr), cvtr_(
nullptr), ocs_bufsize_(0), ocs_buf_(
nullptr) {}
57 virtual bool PushBuffer_(
const void* p,
size_t nbytes,
64 OutputTransform* cvtr_;
66 unsigned char* ocs_buf_;
71 template <
class TRANSFORM>
74 typedef TRANSFORM TransformType;
77 this->SetTransform(&m_Transform);
81 bool result = this->Close();
88 errno_t e = OutputConverterStream::SetTransform(cvtr);
89 if (e != 0) this->SetError(e);
93 TRANSFORM m_Transform;
101 #endif // INCLUDE_NN_NLIB_OUTPUTCONVERTERSTREAM_H_ #define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
OutputStream * GetStream() const noexcept
Gets the input stream that will be the base stream.
The class for holding the OutputTransform derived class.
The base class for classes that act internally like OutputStream to convert data. ...
#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.
#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.