Fraxinus  18.10
An IGT application
cxLogFileWatcherThread.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXLOGFILEWATCHERTHREAD_H
13 #define CXLOGFILEWATCHERTHREAD_H
14 
15 #include "cxResourceExport.h"
16 
17 //#define SSC_PRINT_CALLER_INFO
18 
19 #include <QMetaType>
20 #include <QObject>
21 #include <QMutex>
22 #include <QDateTime>
23 #include <QFile>
24 #include "boost/shared_ptr.hpp"
25 #include "boost/function.hpp"
26 #include "cxDefinitions.h"
27 #include "cxAudio.h"
28 #include <sstream>
29 #include "cxTypeConversions.h"
30 #include "cxLogger.h"
31 #include "cxLogMessage.h"
32 #include <QList>
33 #include <QThread>
34 #include <QFileSystemWatcher>
35 #include "cxLogThread.h"
36 
37 class QString;
38 class QDomNode;
39 class QDomDocument;
40 class QFile;
41 class QTextStream;
42 
49 namespace cx
50 {
51 class LogFile;
52 
58 {
59  Q_OBJECT
60 
61 public:
62  LogFileWatcherThread(QObject* parent = NULL);
63  virtual ~LogFileWatcherThread();
64 
65 private slots:
66  void onDirectoryChanged(const QString& path);
67  void onFileChanged(const QString& path);
68 private:
69  virtual void executeSetLoggingFolder(QString absoluteLoggingFolderPath);
70 
71  std::vector<Message> readMessages(const QString& path);
72 
73  QFileSystemWatcher mWatcher;
74  QString mLogPath;
75  QStringList mInitializedFiles;
76  std::map<QString, LogFile> mFiles;
77 };
78 
79 } //namespace cx
80 
85 #endif // CXLOGFILEWATCHERTHREAD_H
LogFileWatcherThread(QObject *parent=NULL)
Namespace for all CustusX production code.