43typedef enum DescriptorType {
44 UNK_DESC=0, STREAM=14000,
45 PLANE=14001, PACKET=14002,
46 DATASET=15000, PHYSDIM=15001,
47 VARIABLE=15002, CONTEXT=16000,
51DAS_API
const char* das_desc_type_str(
desc_type_t dt);
74typedef struct das_descriptor {
98 struct das_descriptor* parent;
114#define DasDesc_type(P) ((P)->type)
149DAS_API
DasDesc* new_Descriptor(
void);
300 DasDesc* pThis,
const char* sType,
const char* sName,
const char* sVal
311 DasDesc* pThis,
const char* sType, ubyte uType,
const char* sName,
312 const char* sVal,
char cSep,
das_units units,
int nStandard
438 DasDesc* pThis,
const char* sName,
char* pBuf,
size_t uBufSz,
439 char** psVals,
size_t uMaxVals
452 DasDesc* pThis,
const char* sName,
char cSep,
453 char* pBuf,
size_t uBufSz,
char** psVals,
size_t uMaxVals
463 DasDesc* pThis,
const char* sName,
const char* sVal
470 DasDesc* pThis,
const char* sName,
const char* sFmt, ...
484 DasDesc* pThis,
const char* sName,
double value
541 DasDesc* pThis,
const char* sName,
int* pNumItems
548 DasDesc* pThis,
const char* sName,
int nItems,
double* pValues
584 DasDesc* pThis,
const char* sName,
bool bVal
602 DasDesc* pThis,
const char* sName,
char* sMin,
char* sMax,
611 DasDesc* pThis,
const char* sName,
int nItems,
float* pValues
622#define DasDesc_encode DasDesc_encode2
A dynamic buffer with multi-dimensional array style access.
Utility to assist with encode and decode operations.
DAS_API const DasProp * DasDesc_getLocal(const DasDesc *pThis, const char *sName)
Get a property if present in this descriptor only (das3)
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 const DasProp * DasDesc_getProp(const DasDesc *pThis, const char *sName)
Get a property if present in descriptor or it's parent (das3)
desc_type_t
enumeration of Descriptor types, used internally for type checking.
Definition descriptor.h:43
DAS_API DasErrCode DasDesc_encode3(DasDesc *pThis, DasBuf *pBuf, const char *sIndent)
Encode a generic set of properties to a buffer, in das3 format.
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.
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition defs.h:184
const char * das_units
Handle SI and other units, with accommodations for Epoch systems, from units.h.
Definition units.h:144
Dynamic recursive ragged arrays.
Definition array.h:271
Buffer class to handle accumulating byte streams.
Definition buffer.h:47
Base structure for Stream Header Items.
Definition descriptor.h:74
DAS_API DasErrCode DasDesc_setStr(DasDesc *pThis, const char *sName, const char *sVal)
SetProperty methods add properties to any Descriptor (stream,packet,plane).
DAS_API const DasDesc * DasDesc_parent(const DasDesc *pThis)
The the parent of a Descriptor.
DAS_API const char * DasDesc_getValByIdx(const DasDesc *pThis, size_t uIdx)
Get a property value by an index.
DAS_API bool DasDesc_hasLocal(const DasDesc *pThis, const char *sName)
Does this descriptor alone have this property.
DAS_API const char * DasDesc_getStr(const DasDesc *pThis, const char *sName)
read the property of type String named sName.
DAS_API int DasDesc_getInt(const DasDesc *pThis, const char *sName)
Get a property integer value.
DAS_API const char * DasDesc_getTypeByIdx3(const DasDesc *pThis, size_t uIdx)
Get a data type of a property by an index, das3 convention.
DAS_API const char * DasDesc_getTypeByIdx(const DasDesc *pThis, size_t uIdx)
Get a data type of a property by an index.
DAS_API DasErrCode DasDesc_getStrRng(DasDesc *pThis, const char *sName, char *sMin, char *sMax, das_units *pUnits, size_t uLen)
Get a property of type DatumRange with unconverted strings.
DAS_API const char * DasDesc_getNameByIdx(const DasDesc *pThis, size_t uIdx)
Get a property name by an index.
DAS_API DasErrCode DasDesc_setDoubleArray(DasDesc *pThis, const char *sName, int nItems, double *pValues)
Set the property of type double array.
DAS_API bool DasDesc_equals(const DasDesc *pThis, const DasDesc *pOther)
Check to see if two descriptors contain the same properties Note, the order of the properties may be ...
DAS_API DasErrCode DasDesc_encode2(DasDesc *pThis, DasBuf *pBuf, const char *sIndent)
Encode a generic set of properties to a buffer.
DAS_API DasErrCode DasDesc_setDatum(DasDesc *pThis, const char *sName, double rVal, das_units units)
Set property of type Datum (double, UnitType pair)
DAS_API char * DasDesc_info(const DasDesc *pThis, char *sBuf, int nLen, char *sIndent)
Print 1-line versions of each property in a descriptor.
DAS_API bool DasDesc_hasAnyProps(const DasDesc *pThis)
Does this descriptor hold at least one valid property?
DAS_API size_t DasDesc_getStrAry(DasDesc *pThis, const char *sName, char *pBuf, size_t uBufSz, char **psVals, size_t uMaxVals)
Get a multi-valued string property.
DAS_API void DasDesc_freeProps(DasDesc *pThis)
For use in derived destructors, frees the property array.
DAS_API double * DasDesc_getDoubleAry(DasDesc *pThis, const char *sName, int *pNumItems)
Get the values of an array property.
DAS_API DasErrCode DasDesc_setProp(DasDesc *pThis, const DasProp *pProp)
Overwrite, or copy-in a fully formatted property.
DAS_API DasErrCode DasDesc_setDouble(DasDesc *pThis, const char *sName, double value)
Set property of type double.
DAS_API size_t DasDesc_length(const DasDesc *pThis)
Get the number of properties in a descriptor.
DAS_API bool DasDesc_remove(DasDesc *pThis, const char *sName)
Remove a property from a descriptor, if preset.
DAS_API const char * DasDesc_get(const DasDesc *pThis, const char *sName)
Get a raw property string.
DAS_API bool DasDesc_has(const DasDesc *pThis, const char *sName)
Determine if a property is present in a Descriptor or it's ancestors.
DAS_API void DasDesc_clearProps(DasDesc *pThis)
Resets the property count to 0, but frees no memory.
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.
DAS_API DasErrCode DasDesc_setInt(DasDesc *pThis, const char *sName, int nVal)
Set the property of type int.
DAS_API const char * DasDesc_getType(const DasDesc *pThis, const char *sName)
Get the type string for a property.
DAS_API DasErrCode DasDesc_setFloatAry(DasDesc *pThis, const char *sName, int nItems, float *pValues)
Set the property of type float array.
DAS_API DasErrCode DasDesc_vSetStr(DasDesc *pThis, const char *sName, const char *sFmt,...)
Set a string property in the manner of sprintf.
DAS_API const DasProp * DasDesc_getPropByIdx(const DasDesc *pThis, size_t uIdx)
Get a property name by an index.
DAS_API bool DasDesc_getBool(DasDesc *pThis, const char *sName)
Get a property boolean value.
DAS_API DasErrCode DasDesc_set(DasDesc *pThis, const char *sType, const char *sName, const char *sVal)
Generic property setter.
DAS_API void DasDesc_copyIn(DasDesc *pThis, const DasDesc *pOther)
Deepcopy properties into a descriptor.
DAS_API DasErrCode DasDesc_encode3Bare(DasDesc *pThis, DasBuf *pBuf, const char *sIndent)
Encode das3 properties WITHOUT the enclosing properties element.
DAS_API double DasDesc_getDatum(DasDesc *pThis, const char *sName, das_units units)
Get the a numeric property in the specified units.
DAS_API void DasDesc_init(DasDesc *pThis, desc_type_t type)
Initialize a memory location as a valid das descriptor.
DAS_API double DasDesc_getDouble(const DasDesc *pThis, const char *sName)
Read the property of type double named sName.
DAS_API DasErrCode DasDesc_setDatumRng(DasDesc *pThis, const char *sName, double beg, double end, das_units units)
Set property of type DatumRange (double, double, UnitType triple)
Individual properties of a descriptor.
Definition property.h:49
Defines units used for items in the stream, most notably time units that reference an epoch and a ste...