das2C
das core C utilities (v3)
Data Structures | Enumerations | Functions
descriptor.h File Reference
#include <stdbool.h>
#include <das2/units.h>
#include <das2/util.h>
#include <das2/buffer.h>
#include <das2/property.h>
#include <das2/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 DasErrCode DasDesc_flexSet (DasDesc *pThis, const char *sType, ubyte uType, const char *sName, const char *sVal, char cSep, das_units units, int nStandard)
 Create or set a existing property. More...
 
DAS_API DasErrCode DasDesc_setProp (DasDesc *pThis, const DasProp *pProp)
 Overwrite, or copy-in a fully formatted property.
 
const DasPropDasDesc_getProp (const DasDesc *pThis, const char *sName)
 Get a property if present in descriptor or it's parent (das3) More...
 
const DasPropDasDesc_getLocal (const DasDesc *pThis, const char *sName)
 Get a property if present in this descriptor only (das3) More...
 
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 seperator. More...
 
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". More...
 
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_flexSet()

DAS_API DasErrCode DasDesc_flexSet ( DasDesc pThis,
const char *  sType,
ubyte  uType,
const char *  sName,
const char *  sVal,
char  cSep,
das_units  units,
int  nStandard 
)

Create or set a existing property.

Other then memory handling, this is just a wrapper on DasProp_init. See @DasProp_init for the argument description

◆ DasDesc_getProp()

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()

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 seperator.

This is just a helper, though you can use it if you like to specify a a separater 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.