5 #include <QDomDocument>
7 #include <QProcessEnvironment>
15 #define VFS_CREATOR_MAX_OUTSTANDING 100
27 static QString
configAttribute(QVariantMap env, QDomElement e, QString attr,
bool req=
true, QString def=
"");
28 static QString
configPathAttribute(QVariantMap env, QDomElement e, QString attr,
bool req=
true, QString def=
"");
29 static bool configBoolAttribute(QVariantMap env, QDomElement e, QString attr,
bool req=
true,
bool def=
false);
30 static int configIntAttribute(QVariantMap env, QDomElement e, QString attr,
bool req=
true,
int def=0);
31 static double configDoubleAttribute(QVariantMap env, QDomElement e, QString attr,
bool req=
true,
double def=0.0);
44 static void init(QStringList plugins=QStringList(),
bool describe =
false);
49 static void build(QString configFile,
VFS_node *root,
bool printConfig=
false);
50 static void constructConfig(QString configFile, QVariantMap env,
VFS_node *mount,
bool printConfig, QDomNamedNodeMap attrs=QDomNamedNodeMap());
51 static void constructNodes(QDomElement nodeConfig, QVariantMap env,
VFS_node *mount,
bool printConfig=
false);
54 static QMap<QString, VFS_node_interface *>
_plugins;
VFS_creator is a static class used to instantiate nodes.
static VFS_node * constructNode(QDomElement child, QVariantMap &env, bool printConfig=false)
VFS_creator::constructNode.
static QJsonObject codeDirectory(QString &error)
Gather and return a directory of code namespaces served by this VFS instance.
static void build(QString configFile, VFS_node *root, bool printConfig=false)
Build an environment for creating nodes.
static bool registerPlugin(QString name, VFS_node_interface *node)
Register a plugin.
static int configIntAttribute(QVariantMap env, QDomElement e, QString attr, bool req=true, int def=0)
Fetch an XML node attribute value and resolve it against an environment, returning it as an int.
static void constructNodes(QDomElement nodeConfig, QVariantMap env, VFS_node *mount, bool printConfig=false)
Now that the file is open and an environment exists, do the work.
static bool configBoolAttribute(QVariantMap env, QDomElement e, QString attr, bool req=true, bool def=false)
Fetch an XML node attribute value and resolve it against an environment, returning it as a bool.
static VFS_request * code(VFS_request *r)
Resolve a request for code.
static QString configAttribute(QVariantMap env, QDomElement e, QString attr, bool req=true, QString def="")
Fetch an XML node attribute value and resolve it against an environment.
static QMap< QString, VFS_node_interface * > _plugins
The plugin registry.
static void init(QStringList plugins=QStringList(), bool describe=false)
Initialize plugins recursively.
static bool unregisterPlugin(QString name)
Unregister a plugin.
static void constructConfig(QString configFile, QVariantMap env, VFS_node *mount, bool printConfig, QDomNamedNodeMap attrs=QDomNamedNodeMap())
Build nodes from a config file using the provided environment values.
static double configDoubleAttribute(QVariantMap env, QDomElement e, QString attr, bool req=true, double def=0.0)
Fetch an XML node attribute value and resolve it against an environment, returning it as a double val...
static QString configPathAttribute(QVariantMap env, QDomElement e, QString attr, bool req=true, QString def="")
Fetch an XML node attribute value and resolve it against an environment, ensuring it is a cleaned pat...
static QMutex _pluginsLock
A mutex for protecting the _plugins object.
static QVariantMap constructEnvironment(QVariantMap env, QDomElement c)
Construct an environment from an <env> node.
static QString resolveEnvValue(QString value, QVariantMap env)
Resolve an incoming value against the system environment and the provided environment.
static QProcessEnvironment _systemEnvironment
The system environment inherited during startup.
static void setParameters(QVariantMap env, QDomElement c)
Set parameters on the VFS::root() instance, for future query.
static QSemaphore _outstanding
A semaphore used to sync creation during startup.
The interface class for dynamically loaded plugins.
VFS_node is the base class from which all other VFS_node classes derive.
The base class for all requests between nodes.
A thread interface for creating multithreaded applications.
A subclass of QThread, which provides an event loop in a different thread.
VFS is the root node for a Virtual Filesystem.