das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Public Member Functions
DasCodec Struct Reference

Reading and writing array data to buffers. More...

#include <das3/codec.h>

Collaboration diagram for DasCodec:
Collaboration graph
[legend]

Public Member Functions

#define DasCodec_isValid(pCd)   (((pCd)->uProc & DASENC_VALID)==(DASENC_VALID))
 Has the memory for this encoder been initialized?
 
DAS_API DasErrCode DasCodec_init (bool bRead, DasCodec *pThis, DasAry *pAry, const char *sSemantic, const char *sEncType, int16_t uSzEach, ubyte cSep, das_units epoch, const char *sOutFmt)
 Initialize a serial buffer decoder/encoder.
 
DAS_API DasErrCode DasCodec_update (bool bRead, DasCodec *pThis, const char *sEncType, int16_t uSzEach, ubyte cSep, das_units epoch, const char *sOutFmt)
 Update external aspects of a serial buffer decoder/encoder.
 
DAS_API void DasCodec_eatSpace (DasCodec *pThis, bool bEat)
 Set codec to eat extra whitespace, ignored for not text decoding.
 
DAS_API void DasCodec_setTrim (DasCodec *pThis, bool bTrim)
 Enable/disable ltrim+rtrim of decoded values (var-width utf8, default on).
 
DAS_API bool DasCodec_isTrim (const DasCodec *pThis)
 True if this codec trims (DASENC_TRIM).
 
DAS_API void DasCodec_postBlit (DasCodec *pThis, DasAry *pAry)
 Fix array pointer after a DasCodec memory copy.
 
DAS_API DasErrCode DasCodec_setIdxTerms (DasCodec *pThis, ubyte nLevels, const char *sLevels)
 Attach the per-index run terminators after codec creation.
 
DAS_API bool DasCodec_isReader (const DasCodec *pThis)
 Is this codec setup and a reader from external buffers or a write to them ?
 
DAS_API bool DasCodec_isText (const DasCodec *pThis)
 Does this codec emit (or read) text, i.e.
 
DAS_API int DasCodec_decode (DasCodec *pThis, const ubyte *pBuf, int nBufLen, int nExpect, int *pValsRead)
 Read values from a simple buffer into an array.
 
DAS_API int DasCodec_raggedIndices (const DasCodec *pThis, int *aRagIdx)
 Locate the external ragged indices this codec's runs close.
 
DAS_API int DasCodec_decodeRuns (DasCodec *pThis, const ubyte *pBuf, int nBufLen, bool bLastVar, int *pValsRead)
 Read terminator-bounded (idxTerm) ragged runs from a buffer.
 
DAS_API int DasCodec_encodeRuns (DasCodec *pThis, DasBuf *pBuf, ptrdiff_t iRec)
 Write one record's terminator-bounded (idxTerm) ragged run to a buffer.
 
DAS_API void DasCodec_deInit (DasCodec *pThis)
 Release the reference count on the array given to this encoder/decoder.
 

Detailed Description

Reading and writing array data to buffers.


The documentation for this struct was generated from the following file: