Remoto - VFS: VFS_node_type.h Source File
Remoto - VFS
VFS_node_type.h
Go to the documentation of this file.
1 
2 #ifndef VFS_NODE_TYPE_H
3 #define VFS_NODE_TYPE_H
4 
5 #include <QString>
6 #include <QMap>
7 
9 {
10  public:
11  static QString getType(QString _path, QString _default="unknownType");
12  static bool isJsonType(QString _type);
13 
14  static bool registerType(QString type, QString handler, bool json=true);
15  static bool unregisterType(QString type);
16 
17  static QMap<QString,QString> initTypes();
18  static QMap<QString,bool> initJsons();
19 
20  private:
21  static QMap<QString, QString> typeMap;
22  static QMap<QString, bool> jsonMap;
23 };
24 
25 #endif // VFS_NODE_TYPE_H
26 
The type registry for file extensions.
Definition: VFS_node_type.h:9
static bool registerType(QString type, QString handler, bool json=true)
Add a type to the registry.
static QMap< QString, QString > initTypes()
Initialize the type library.
static QMap< QString, bool > initJsons()
Initialize the jsons library.
static bool isJsonType(QString _type)
Check if a type is known to be json.
static QMap< QString, QString > typeMap
The extension:type map.
Definition: VFS_node_type.h:21
static QString getType(QString _path, QString _default="unknownType")
Fetch the type of a file, based on path/filename.ext.
static QMap< QString, bool > jsonMap
The extension:isjson map.
Definition: VFS_node_type.h:22
static bool unregisterType(QString type)
Remove a type from the registry.