![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cStream.h>
Public Member Functions | |
cStreamOutput () noexcept | |
virtual | ~cStreamOutput () |
virtual HRESULT | WriteX (const void *pData, size_t nDataSize) |
HRESULT | WriteT (const void *pVal, size_t nDataSize) |
template<typename TYPE > | |
HRESULT | WriteT (TYPE val) |
HRESULT | WriteSize (size_t nSize) |
HRESULT | WriteHashCode (HASHCODE_t nHashCode) |
HRESULT | WriteN (const void *pBuffer, size_t nSize) |
template<typename _CH > | |
HRESULT | WriteStringN (const _CH *pszStr) |
template<typename _CH > | |
HRESULT | WriteCharRepeat (_CH nChar, int nCount=1) |
virtual HRESULT | WriteString (const char *pszStr) |
virtual HRESULT | WriteString (const wchar_t *pszStr) |
StrLen_t | VPrintf (const char *pszFormat, va_list args) |
StrLen_t | VPrintf (const wchar_t *pszFormat, va_list args) |
StrLen_t _cdecl | Printf (const char *pszFormat,...) |
StrLen_t _cdecl | Printf (const wchar_t *pszFormat,...) |
HRESULT | WriteStream (cStreamInput &sInp, STREAM_POS_t nSizeMax=k_FILE_BLOCK_SIZE, IStreamProgressCallback *pProgress=nullptr, TIMESYSD_t nTimeout=0) |
Copy cStreamInput to this stream. More... | |
virtual HRESULT | FlushX () |
![]() | |
virtual | ~cStreamBase () |
virtual STREAM_SEEKRET_t | Seek (STREAM_OFFSET_t iOffset, SEEK_ORIGIN_TYPE eSeekOrigin=SEEK_Set) |
void | SeekToBegin () |
STREAM_POS_t | SeekToEnd () |
virtual STREAM_POS_t | GetPosition () const |
virtual STREAM_POS_t | GetLength () const |
Additional Inherited Members | |
![]() | |
static const BYTE | k_SIZE_MASK = 0x80 |
Used for WriteSize() More... | |
static const size_t | k_FILE_BLOCK_SIZE = (32 * 1024) |
default arbitrary transfer block size. more than this is NOT more efficient. More... | |
Write a stream of data/text out to some arbitrary destination. i.e. console, file, socket, telnet, game client, web page client, etc.. May be no Seek() method available / implemented. similar to STL std::ostream, and IWriteStream
|
inlinenoexcept |
|
inlinevirtual |
|
inlinevirtual |
virtualized fflush() or FlushFileBuffers()
Reimplemented in GrayLib::cLogFileDay, GrayLib::cStreamZLibDecompress, GrayLib::cStreamZLibCompress, GrayLib::cStreamBZ2Decompress, GrayLib::cStreamBZ2Compress, Gray::cFileText, and Gray::cFile.
|
inline |
Write just the chars of the string. NOT nullptr Does NOT assume include NewLine or automatically add one.
|
inline |
Write just the chars of the string. NOT nullptr
|
inline |
Write just the chars of the string. NOT nullptr
|
inline |
Write just the chars of the string. NOT nullptr
|
inline |
Repeat writing of a char/wchar_t * nCount.
|
inline |
opposite of ReadHashCode()
|
inline |
Write a block prefixed by its size (Bytes). Write out a string with the length prefix.
HRESULT Gray::cStreamOutput::WriteSize | ( | size_t | nSize | ) |
Write a packed (unsigned) size_t. opposite of ReadSize(nSize) Packed low to high values. Bit 7 indicates more data needed. similar to ASN1 Length packing.
HRESULT Gray::cStreamOutput::WriteStream | ( | cStreamInput & | sInp, |
STREAM_POS_t | nSizeMax = k_FILE_BLOCK_SIZE , |
||
IStreamProgressCallback * | pProgress = nullptr , |
||
TIMESYSD_t | nTimeout = 0 |
||
) |
Copy cStreamInput to this stream.
Copy data from one read stream (stmIn) to another write stream (this).
|
inlinevirtual |
Write just the chars of the string. NOT nullptr. like fputs() Does NOT assume include NewLine or automatically add one.
Reimplemented in Gray::cLogMgr, GrayLib::cLogFileDay, Gray::cLogAppendDebug, Gray::cLogAppender, Gray::cLogAppendTextArray, Gray::cLogAppendConsole, GrayX::cCmdTail, GrayLib::cXProtocolServerStream, Gray::cFileText, and Gray::cAppConsole.
|
inlinevirtual |
Write just the chars of the string. NOT nullptr. like fputs() Does NOT assume include NewLine or automatically add one.
Reimplemented in Gray::cLogMgr, Gray::cFileText, Gray::cAppConsole, and Gray::cLogAppender.
|
inline |
Write out a string with the length prefix. ReadStringN()
|
inline |
Write all or nothing (fail). otherwise same as WriteX() (where partials are allowed)
|
inlinevirtual |
Write a data block to the stream. NOT pure virtual function. stub implementation.
Reimplemented in Gray::cStreamStackOut, GraySSL::cSSLCommon, GrayLib::cSerialPort, GrayLib::cNetStream, GrayLib::cNetSocket, GrayLib::cFileMem, GrayLib::cStreamZLibCompress, GrayLib::cStreamCipherEnc, GrayLib::cStreamBZ2Compress, GrayLib::cAudioADPCMEnc, Gray::cStreamStackPackets, Gray::cStreamStatic, Gray::cStreamQueue, Gray::cStreamNull, Gray::cStreamTextReader, Gray::cFileText, Gray::cFile, GrayLib::cAVControlInp, GrayLib::cOSPipeClient, and GrayLib::cMailslotWriter.