Schim
variable.h
1 #ifndef VARIABLE_H
2 #define VARIABLE_H
3 
4 #include <QString>
5 #include <QSet>
6 
7 struct Variable;
8 
9 typedef QList<Variable> VariableSet;
10 
24 struct Variable
25 {
26  // PUBLIC ATTRIBUTES
31  QStringList names;
32  QString value, description;
33 
34  // CONSTRUCTORS
35  Variable() = default;
36  explicit Variable(const QStringList &names, const QString &value = "");
37  Variable(const QStringList &names, const QString &value, const QString
38  &description);
39 
40  // GETTERS
41  QString getTrueName() const;
42  QStringList getAliases() const;
43 
44  // STATIC
46  static QString allowedPatterns();
48  static Variable find(const VariableSet &list, QString name);
60  static QString substitute(QString str, const VariableSet &variableSet);
61 
62  // OPERATORS
63  bool operator==(const Variable &var) const;
64 };
65 
66 #endif // VARIABLE_H
Definition: variableset.h:4
QStringList names
Contains all names that can be used to identify this variable, separated by a comma.
Definition: variable.h:31
static QString substitute(QString str, const VariableSet &variableSet)
Substitute all variables in str with their values.
static Variable find(const VariableSet &list, QString name)
Find a variable named name inside list and return it.
static QString allowedPatterns()
Return the regex pattern that represents a valid variable name.
A model representation of a variable.
Definition: variable.h:24