|
ADTF
|
#include <stream.h>
Inherits adtf::ucom::catwo::object< IInputStream, IOutputStream, IStream >.
Public Types | |
| enum | tStreamType : uint8_t { INPUT_STREAM = 1 , OUTPUT_STREAM = 2 } |
Public Member Functions | |
| cStream (tStreamType eType, tFileSize szBuffer=0, uint32_t ui32Flags=0) | |
| virtual | ~cStream () |
| tResult | SetSize (tFileSize szBuffer, uint32_t ui32Flags=0) |
| tResult | CopyTo (cStream &strmOutput) const |
| tResult | CopyFrom (cStream &strmInput) |
| const void * | GetCurrentPtr () const |
| tFileSize | GetCurrentSize () const |
| tFileSize | GetHighestPosIndex () const |
| tResult | AttachReference (void *pReferenceBuffer, tFileSize szBufferSize) |
| tResult | DetachReference () |
| tResult | Read (void *pvBuffer, size_t nBufferSize, size_t *pnBytesRead=nullptr) const override |
| tResult | Write (const void *pvBuffer, size_t nBufferSize, size_t *pnBytesWritten=nullptr) override |
| tResult | Seek (tFilePos nPos, tSeekOrigin eOrigin, tFilePos *pNewPos=nullptr) const override |
| tResult | Reset () override |
| tResult | Flush () override |
Public Member Functions inherited from adtf::ucom::catwo::object< IInputStream, IOutputStream, IStream > | |
| tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
| Query interfaces on an object. | |
| tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
| Provides const correct interface querying. | |
| void | Destroy () const override |
| Switch from non-virtual destructor to virtual destructor. | |
| tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
| Query interfaces on an object. | |
| tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
| Provides const correct interface querying. | |
| void | Destroy () const override |
| Switch from non-virtual destructor to virtual destructor. | |
| tResult | GetInterface (const char *i_strIID, void *&o_pInterface) override |
| Query interfaces on an object. | |
| tResult | GetInterface (const char *i_strIID, const void *&o_pInterface) const override |
| Provides const correct interface querying. | |
| void | Destroy () const override |
| Switch from non-virtual destructor to virtual destructor. | |
Public Member Functions inherited from adtf::ucom::ant::IObject | |
| ADTF_IID (IObject, "object.ant.ucom.adtf.iid") | |
Protected Types | |
| enum | tStreamFlags { FLG_KEEP_POSITION = 1 , FLG_DONT_GROW = 2 } |
Protected Member Functions | |
| bool | IsEof () const |
| tFileSize | GetRemainingBytes () const |
Protected Member Functions inherited from adtf::ucom::ant::IObject | |
| ~IObject ()=default | |
| Protected destructor --> Only the final implementation can be destroyed! | |
Protected Attributes | |
| tStreamType | m_eType |
| Type of Stream, see tStreamType. | |
|
protected |
Stream flags.
| Enumerator | |
|---|---|
| FLG_KEEP_POSITION | Sets correct end of file marker at.
|
| FLG_DONT_GROW | Will only have the at construction time decided size. |
| enum adtf::ucom::ant::cStream::tStreamType : uint8_t |
|
explicit |
Constructs a Stream with the current size.
| eType | [in] The In or Ouput Type. |
| szBuffer | [in] The stream buffer size which will be preallocated. |
| ui32Flags | [in] The creating flags ( |
|
virtual |
Destructor.
| tResult adtf::ucom::ant::cStream::AttachReference | ( | void * | pReferenceBuffer, |
| tFileSize | szBufferSize ) |
Reference to a extern buffer (no intern buffer will be used to write to or read from). Mind: A SetSize will be failed, while a Buffer is attached!!
| pReferenceBuffer | Reference to the extern buffer. |
| szBufferSize | Size of the Extern buffer. |
Copies content from another Stream.
| strmInput | The Stream to copy from. |
Copies a Stream to another.
| strmOutput | The Stream to copy to. |
| tResult adtf::ucom::ant::cStream::DetachReference | ( | ) |
|
override |
Implements
| const void * adtf::ucom::ant::cStream::GetCurrentPtr | ( | ) | const |
Gets the address of the buffers current seek position.
| tFileSize adtf::ucom::ant::cStream::GetCurrentSize | ( | ) | const |
Returns the current buffer size.
| tFileSize adtf::ucom::ant::cStream::GetHighestPosIndex | ( | ) | const |
Returns the current buffer size which was written (without a gap at the end).
|
protected |
|
protected |
Checks if end of stream is reached.
| true | End of stream reached |
| false | End of stream is not reached |
|
override |
Implements
| pvBuffer | reference address the cStream will copy the read data to. |
| nBufferSize | size of bytes to read. |
| pnBytesRead | return value for size of bytes read. |
|
override |
Implements
|
override |
Implements IStream::Seek. Sets the current position in the stream.
| nPos | Position to set to (in bytes). |
| eOrigin | IStream::tSeekOrigin. |
| pNewPos | return value for the new position (same as |
| tResult adtf::ucom::ant::cStream::SetSize | ( | tFileSize | szBuffer, |
| uint32_t | ui32Flags = 0 ) |
Sets the current size of the stream.
| szBuffer | [in] The stream buffer size which will be allocated. |
| ui32Flags | [in] The set size flags ( |
|
override |
Implements
| pvBuffer | reference address the cStream will copy the data from. |
| nBufferSize | size of bytes to write. |
| pnBytesWritten | return value for size of bytes written. |