GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmParseUtils.h File Reference

Utilitary functions for parsing model constructions. More...

#include "gmCoreConfig.h"
#include "gmInterpolator.h"
#include <QVariant>
Include dependency graph for gmParseUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  GmParseUtils
 Groups utilitary routines for parsing models.
 

Functions

int GmParseUtils::parseDimension (QVariant dim, int *nlin, int *ncol, int *ndepth)
 An auxiliary function to parse dimension values that can be expressed both as a single number or a string in the format 'dxd' (and optionally in the format 'dxdxd' if ndepth != NULL).
 
bool GmParseUtils::parseFormat (QString formatStr, int *fieldWidth, char *format, int *precision, bool useDefaults)
 An auxiliary function used to parse a format string using the syntax: "%d.%d[fgeGE]" Returns the parsed formats in the arguments fieldWidth, format and precision.
 
void GmParseUtils::parseDefault (QVariant def, int nlin, int ncol, QString &defString, double *defVal)
 An auxiliary function used to parse a default value definition, accepting scalars, tables or function/constant names.
 
bool GmParseUtils::parseDataSrcString (QString str, bool extName, QString &src, QString *unit, int *dim, QString *as)
 
bool GmParseUtils::parseDataSrc (QVariant def, QString &srcId, QString *unit, int *dim, QString *alias, int *history, bool acceptsNoInterp, GmInterpolatorType *interpType, QVariant *interpParam, GmInterpolatorSubset *subset, QString &err)
 
int GmParseUtils::stringOptionIndex (QString value, const char **optionNames, const char *fieldName, QString &err)
 Looks for value in optionNames. If found returns the index. If not found returns -1 and fills err with a message.
 
QVector< quint64 > GmParseUtils::parseHexMask (QString hexStr, int max64Groups, const char *fieldName, QString &err)
 Receives a string with Hex values, like 'a24df5' or '0xa24df5' and returns a vector with max64Groups quint64 values where the least 8 significative bytes are on the first vector entry, the next on entry 1 and so on. If the string mask can not fit in the given number of groups, or if the input string is not an hex string, returns an empty vector, filling err with a message.
 

Detailed Description

Utilitary functions for parsing model constructions.

Author
Carlos Augusto Teixeira Mendes
Date
august, 2021