2014-01-12 13:31:59 +00:00
|
|
|
#ifndef cmStrStream_h
|
|
|
|
#define cmStrStream_h
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-11-16 19:59:27 +00:00
|
|
|
//( { file_desc:"String stream text sink." kw:[text] }
|
|
|
|
|
2014-01-12 13:31:59 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
kOkSsRC = cmOkRC,
|
|
|
|
kLHeapMemFailSsRC
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef cmHandle_t cmStrStreamH_t;
|
|
|
|
typedef cmRC_t cmSsRC_t;
|
|
|
|
|
2014-01-12 15:23:23 +00:00
|
|
|
extern cmStrStreamH_t cmStrStreamNullHandle;
|
2014-01-12 13:31:59 +00:00
|
|
|
|
|
|
|
|
2014-01-12 18:06:13 +00:00
|
|
|
// If 'dfltBlkByteCnt' 'is set to 0 then the dfltBlkByteCnt is internally set to 4096.
|
2014-01-12 13:31:59 +00:00
|
|
|
cmSsRC_t cmOStrStreamCreate( cmCtx_t* ctx, cmStrStreamH_t* hp, unsigned dfltBlkByteCnt );
|
2014-01-12 18:06:13 +00:00
|
|
|
cmSsRC_t cmOStrStreamDestroy( cmStrStreamH_t* hp );
|
2014-01-12 13:31:59 +00:00
|
|
|
|
|
|
|
bool cmOStrStreamIsValid( cmStrStreamH_t h );
|
|
|
|
|
|
|
|
cmSsRC_t cmOStrStreamWrite( cmStrStreamH_t h, const void* dp, unsigned byteCnt );
|
|
|
|
cmSsRC_t cmOStrStreamWriteStr( cmStrStreamH_t h, const cmChar_t* str );
|
2014-01-12 15:23:23 +00:00
|
|
|
cmSsRC_t cmOStrStreamWriteStrN( cmStrStreamH_t h, const cmChar_t* str, unsigned n );
|
2014-01-12 13:31:59 +00:00
|
|
|
cmSsRC_t cmOStrStreamVPrintf( cmStrStreamH_t h, const cmChar_t* fmt, va_list vl );
|
|
|
|
cmSsRC_t cmOStrStreamPrintf( cmStrStreamH_t h, const cmChar_t* fmt, ... );
|
|
|
|
|
|
|
|
unsigned cmOStrStreamByteCount( cmStrStreamH_t h );
|
|
|
|
void* cmOStrStreamAllocBuf( cmStrStreamH_t h );
|
|
|
|
cmChar_t* cmOStrStreamAllocText( cmStrStreamH_t h );
|
|
|
|
|
2015-11-16 19:59:27 +00:00
|
|
|
//)
|
|
|
|
|
2014-01-12 13:31:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|