das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
descriptor.h File Reference
#include <stdbool.h>
#include <das3/units.h>
#include <das3/util.h>
#include <das3/buffer.h>
#include <das3/property.h>
#include <das3/array.h>
Include dependency graph for descriptor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DasDesc
 Base structure for Stream Header Items. More...
 

Enumerations

enum  desc_type_t
 enumeration of Descriptor types, used internally for type checking. More...
 

Functions

DAS_API const DasPropDasDesc_getProp (const DasDesc *pThis, const char *sName)
 Get a property if present in descriptor or it's parent (das3)
 
DAS_API const DasPropDasDesc_getLocal (const DasDesc *pThis, const char *sName)
 Get a property if present in this descriptor only (das3)
 
DAS_API size_t DasDesc_getArray (DasDesc *pThis, const char *sName, char cSep, char *pBuf, size_t uBufSz, char **psVals, size_t uMaxVals)
 Get string array with given separator.
 
DAS_API DasErrCode DasDesc_setBool (DasDesc *pThis, const char *sName, bool bVal)
 Set a boolean property Encodes the value as either the string "true" or the string "false".
 
DAS_API DasErrCode DasDesc_encode3 (DasDesc *pThis, DasBuf *pBuf, const char *sIndent)
 Encode a generic set of properties to a buffer, in das3 format.
 

Enumeration Type Documentation

◆ desc_type_t

enumeration of Descriptor types, used internally for type checking.

May have one of the following values:

  1. PLANE
  2. PACKET
  3. STREAM
  4. PHYSDIM
  5. DATASET

Function Documentation

◆ DasDesc_getProp()

DAS_API const DasProp * DasDesc_getProp ( const DasDesc pThis,
const char *  sName 
)

Get a property if present in descriptor or it's parent (das3)

Parameters
pThisthe descriptor object to query
sNamethe name of the property to retrieve.
Returns
a the property, if present here or in a parent descriptor, NULL otherwise

◆ DasDesc_getLocal()

DAS_API const DasProp * DasDesc_getLocal ( const DasDesc pThis,
const char *  sName 
)

Get a property if present in this descriptor only (das3)

In das3 property cascades don't make as much sense. The label for a particular physical dim axis is not the stream label. Clients may want a property for just this object.

Parameters
pThisthe descriptor object to query
sNamethe name of the property to retrieve.
Returns
a the property, if present here NULL otherwise

◆ DasDesc_getArray()

DAS_API size_t DasDesc_getArray ( DasDesc pThis,
const char *  sName,
char  cSep,
char *  pBuf,
size_t  uBufSz,
char **  psVals,
size_t  uMaxVals 
)

Get string array with given separator.

This is just a helper, though you can use it if you like to specify a a separator character. The combination '\SEP' is treated as a literal SEP and does not break a field. Literal '\' characters have no meaning unless followed by a SEP character.

See also
DasDesc_getStrAry

◆ DasDesc_setBool()

DAS_API DasErrCode DasDesc_setBool ( DasDesc pThis,
const char *  sName,
bool  bVal 
)

Set a boolean property Encodes the value as either the string "true" or the string "false".

Parameters
pThisThe descriptor to receive the property
sNamethe name of the property
bValeither true or false.