44 #ifndef VSI_CONTEXT_HH 45 #define VSI_CONTEXT_HH 49 #include <QStringList> 74 explicit Context (QScriptEngine *_engine);
80 void parse (QByteArray _xml);
83 const QVector<Element *>&
elements ()
const {
return elements_; };
86 QVector<Element *>
elements (QString _category);
104 bool canConvert (QString _type1, QString _type2);
113 static QString
getXmlString (QXmlQuery &_xml, QString _expr, QString _default =
"");
118 void parseElement (QXmlQuery &_xml);
130 bool parseInOutBase (QXmlQuery &_xml,
InOut *_io);
133 QVector <Element *> elements_;
135 QMap <QString, Type*> supportedTypes_;
137 QList <Type *> types_;
139 QScriptEngine *scriptEngine_;
Context(QScriptEngine *_engine)
Constructor.
bool canConvert(QString _type1, QString _type2)
Can the given types be converted to each other.
QStringList categories()
List of categories.
bool typeSupported(QString _type)
Is the given type supported.
const QVector< Element * > & elements() const
Returns all available elements.
static bool strToBool(QString _str)
Converts the given string to bool.
void parse(QByteArray _xml)
Parse xml content.
QScriptEngine * scriptEngine()
Return script engine pointer.
Element * element(QString _name)
Returns the element with a given name.
void registerType(Type *_type)
Registers a supported datatype.
Type * getType(QString _type)
Get type object for given type name.
static QString getXmlString(QXmlQuery &_xml, QString _expr, QString _default="")
Gets the string of a xml query.