GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmParseUtils.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PARSE_UTILS_H_
25#define _GEMA_PARSE_UTILS_H_
26
27#include "gmCoreConfig.h"
28#include "gmInterpolator.h"
29
30#include <QVariant>
31
32
34namespace GmParseUtils
35{
36 GMC_API_EXPORT int parseDimension (QVariant dim, int* nlin, int* ncol, int* ndepth = NULL);
37 GMC_API_EXPORT bool parseFormat (QString formatStr, int* fieldWidth, char* format, int* precision, bool useDefaults = false);
38 GMC_API_EXPORT void parseDefault (QVariant def, int nlin, int ncol, QString& defString, double* defVal);
39 GMC_API_EXPORT bool parseDataSrcString(QString str, bool extName, QString& src, QString* unit, int* dim, QString* as);
40
41 GMC_API_EXPORT bool parseDataSrc(QVariant def, QString& srcId, QString* unit, int* dim, QString* alias,
42 int* history, bool acceptsNoInterp, GmInterpolatorType* interpType,
43 QVariant* interpParam, GmInterpolatorSubset* subset, QString& err);
44
45 GMC_API_EXPORT int stringOptionIndex(QString value, const char** optionNames, const char* fieldName, QString& err);
46
47 GMC_API_EXPORT QVector<quint64> parseHexMask(QString hexStr, int max64Groups, const char* fieldName, QString& err);
48}
49
50#endif
Declaration of useful configuration definitions for the Core library.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmInterpolator and GmInterpolatorObject classes.
GmInterpolatorType
Available interpolation methods. Not every method is suitable for every kind of interpolator class....
Definition gmInterpolator.h:64
Groups utilitary routines for parsing models.
Definition gmParseUtils.cpp:34
int 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 wit...
Definition gmParseUtils.cpp:404
QVector< quint64 > 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 ...
Definition gmParseUtils.cpp:431
bool 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 pars...
Definition gmParseUtils.cpp:110
int 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 st...
Definition gmParseUtils.cpp:49
void parseDefault(QVariant def, int nlin, int ncol, QString &defString, double *defVal)
An auxiliary function used to parse a default value definition, accepting scalars,...
Definition gmParseUtils.cpp:167