The AttributeRange base class.
More...
#include <attributerange.h>
|
enum | Type {
Invalid,
Double_Range,
Int_Range,
Bool,
Double_Set,
Int_Set,
String_Set,
String,
NonEmptyString,
DirPath,
FilePath
} |
| An enum for the attribute range types. More...
|
|
|
const int | m_id |
|
const QString | m_attrName |
|
const Type | m_type |
|
QString | m_attrRangeStr |
|
Value | m_min |
|
Value | m_max |
|
◆ Type
An enum for the attribute range types.
Enumerator |
---|
Invalid | Invalid type.
|
Double_Range | A range of real numbers.
|
Int_Range | A range of integers.
|
Bool | A boolean.
|
Double_Set | A set of real numbers.
|
Int_Set | A set of intergers.
|
String_Set | A set of strings.
|
String | A string.
|
NonEmptyString | A non-empty string.
|
DirPath | A directory path.
|
FilePath | A file path.
|
◆ AttributeRange()
evoplex::AttributeRange::AttributeRange |
( |
int |
id, |
|
|
const QString & |
attrName, |
|
|
Type |
type |
|
) |
| |
|
explicitprotected |
◆ attrRangeStr()
const QString & evoplex::AttributeRange::attrRangeStr |
( |
| ) |
const |
|
inline |
◆ isValid()
bool evoplex::AttributeRange::isValid |
( |
| ) |
const |
|
inline |
◆ parse()
static AttributeRangePtr evoplex::AttributeRange::parse |
( |
int |
attrId, |
|
|
const QString & |
attrName, |
|
|
const QString & |
attrRangeStr |
|
) |
| |
|
static |
Creates an AttributeRange object from a valid attrRangeStr
string.
- Parameters
-
attrId | The attribute id. |
attrName | The attribute name. |
attrRangeStr | The attribute range string. |
- Returns
- Returns a null object if
attrRangeStr
is invalid.
The accepted 'attrRangeStr'
strings are listed in the table below.
Attribute Range | Description |
"bool" | a boolean |
"dirpath" | a string containing a valid dirpath (use forward slashes) |
"filepath" | a string containing a valid filepath (use forward slashes) |
"string" | a string (empty string is also valid) |
"non-empty-string" | a non-empty string |
"string{aaa,bbb}" | set of strings |
"int[min,max]" | integers from min to max (including min and max) |
"int{1,2,3}" | set of integers |
"double[min,max]" | doubles from min to max (including min and max) |
"double{1.1,1.2}" | set of doubles |
- Note
- You can use 'max' to take the maximum value for the type. For instance, 'int[0,max]' corresponds to an integer from 0 to 2147483647, which is the largest integer.
- Warning
- Do NOT add spaces before/after the commas.
◆ validate()
Value evoplex::AttributeRange::validate |
( |
const QString & |
valueStr | ) |
const |
Checks if the valueStr
belongs to this attribute range.
- Parameters
-
valueStr | A value as a string. |
- Returns
- An empty/invalid Value if
valueStr
is not within this range.
The documentation for this class was generated from the following file: