3 #ifndef INCLUDE_NN_NLIB_OUTPUTCONVERTERSTREAM_H_
4 #define INCLUDE_NN_NLIB_OUTPUTCONVERTERSTREAM_H_
13 virtual ~OutputTransform() {}
14 virtual errno_t Transform(OutputStream* os,
const void* p,
size_t nBytes,
bool doFlush) = 0;
18 virtual void* GetWorkBuffer(
size_t* n) = 0;
21 virtual errno_t OnSetStream(OutputStream* os) = 0;
24 virtual errno_t OnClose(OutputStream* os) = 0;
42 virtual bool PushBuffer_(
const void* p,
size_t nBytes,
45 virtual
void* GetWorkBuffer_(
size_t* nBytes) NLIB_NOEXCEPT
NLIB_OVERRIDE NLIB_FINAL;
49 OutputTransform* m_Cvtr;
56 template <class TRANSFORM>
59 typedef TRANSFORM TransformType;
62 this->SetTransform(&m_Transform);
66 bool result = this->
Close();
71 void SetTransform(OutputTransform* cvtr) NLIB_NOEXCEPT {
73 errno_t e = OutputConverterStream::SetTransform(cvtr);
78 TRANSFORM m_Transform;
86 #endif // INCLUDE_NN_NLIB_OUTPUTCONVERTERSTREAM_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_FINAL
Defines final 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...
#define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
bool Close() noexcept
Closes the stream after it has been flushed. Returns true if successful.
The class for holding the OutputTransform derived class.
The base class for classes that act internally like OutputStream to convert data. ...
OutputStream * GetStream() const noexcept
Gets the input stream that will be the base stream.
void SetError(errno_t e) const noexcept
Sets an error to OutputStream.
Defines the base class for output streams.
The base class for output streams. This class cannot be instantiated.