MythTV  master
fileserverhandler.h
Go to the documentation of this file.
1 #ifndef FILESERVER_H_
2 #define FILESERVER_H_
3 
4 #include <QMutex>
5 
11 
13 {
14  Q_OBJECT
15  public:
16  bool HandleAnnounce(MythSocket *socket, QStringList &commands,
17  QStringList &slist) override; // SocketRequestHandler
18  bool HandleQuery(SocketHandler *socket, QStringList &commands,
19  QStringList &slist) override; // SocketRequestHandler
20  QString GetHandlerName(void) override // SocketRequestHandler
21  { return "FILETRANSFER"; }
22 
23  void connectionAnnounced(MythSocket *socket, QStringList &commands,
24  QStringList &slist) override; // SocketRequestHandler
25  void connectionClosed(MythSocket *socket) override; // SocketRequestHandler
26 
27  static bool DeleteFile(const QString& filename, const QString& storagegroup);
28 
29  static QList<FileSystemInfo> QueryFileSystems(void);
30  QList<FileSystemInfo> QueryAllFileSystems(void);
31 
32  private:
33  static bool HandleQueryFreeSpace(SocketHandler *socket);
34  bool HandleQueryFreeSpaceList(SocketHandler *socket);
35  bool HandleQueryFreeSpaceSummary(SocketHandler *socket);
36 
37  static bool HandleQueryCheckFile(SocketHandler *socket, QStringList &slist);
38  static bool HandleQueryFileExists(SocketHandler *socket, QStringList &slist);
39  bool HandleQueryFileHash(SocketHandler *socket, QStringList &slist);
40 
41  static bool HandleDeleteFile(SocketHandler *socket, QStringList &slist);
42  static bool HandleDeleteFile(SocketHandler *socket, const QString& filename,
43  const QString& storagegroup);
44  bool HandleDeleteFile(QString filename, QString storagegroup);
45  static bool HandleDeleteFile(DeleteHandler *handler);
46 
47  bool HandleGetFileList(SocketHandler *socket, QStringList &slist);
48  bool HandleFileQuery(SocketHandler *socket, QStringList &slist);
49  bool HandleQueryFileTransfer(SocketHandler *socket, QStringList &commands,
50  QStringList &slist);
51  bool HandleDownloadFile(SocketHandler *socket, QStringList &slist);
52 
53  static QString LocalFilePath(const QString &path, const QString &wantgroup);
54  static void RunDeleteThread(void);
55 
56  QMap<int, FileTransfer*> m_ftMap;
57  QReadWriteLock m_ftLock;
58 
59  QMap<QString, SocketHandler*> m_fsMap;
60  QReadWriteLock m_fsLock;
61 
63  QMap<QString, QString> m_downloadURLs;
64 };
65 
66 #endif
filesysteminfo.h
mythsocketmanager.h
SocketRequestHandler::connectionClosed
virtual void connectionClosed(MythSocket *)
Definition: socketrequesthandler.h:28
FileServerHandler::m_fsLock
QReadWriteLock m_fsLock
Definition: fileserverhandler.h:60
MythSocket
Class for communcating between myth backends and frontends.
Definition: mythsocket.h:25
SocketRequestHandler::connectionAnnounced
virtual void connectionAnnounced(MythSocket *, QStringList &, QStringList &)
Definition: socketrequesthandler.h:26
fileserverutil.h
FileServerHandler::m_ftLock
QReadWriteLock m_ftLock
Definition: fileserverhandler.h:57
FileServerHandler::GetHandlerName
QString GetHandlerName(void) override
Definition: fileserverhandler.h:20
DeleteHandler
Definition: fileserverutil.h:17
FileServerHandler::m_downloadURLs
QMap< QString, QString > m_downloadURLs
Definition: fileserverhandler.h:63
mythprotoserverexp.h
FileServerHandler::m_fsMap
QMap< QString, SocketHandler * > m_fsMap
Definition: fileserverhandler.h:59
filetransfer.h
SocketRequestHandler::HandleQuery
virtual bool HandleQuery(SocketHandler *, QStringList &, QStringList &)
Definition: socketrequesthandler.h:22
PROTOSERVER_PUBLIC
#define PROTOSERVER_PUBLIC
Definition: mythprotoserverexp.h:9
FileServerHandler
Definition: fileserverhandler.h:12
FileServerHandler::m_ftMap
QMap< int, FileTransfer * > m_ftMap
Definition: fileserverhandler.h:56
SocketRequestHandler::HandleAnnounce
virtual bool HandleAnnounce(MythSocket *, QStringList &, QStringList &)
Definition: socketrequesthandler.h:19
SocketHandler
Definition: sockethandler.h:16
SocketRequestHandler
Definition: socketrequesthandler.h:12
build_compdb.filename
filename
Definition: build_compdb.py:21
FileServerHandler::m_downloadURLsLock
QMutex m_downloadURLsLock
Definition: fileserverhandler.h:62