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