openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
file_eraser.h
Go to the documentation of this file.
1 #ifndef __lib_components_file_eraser_h
2 #define __lib_components_file_eraser_h
3 
4 #include <lib/base/thread.h>
5 #include <lib/base/message.h>
6 #include <lib/base/ebase.h>
7 
8 class eBackgroundFileEraser: public eMainloop, private eThread, public sigc::trackable
9 {
10  struct Message
11  {
12  std::string filename;
13  Message()
14  {}
15  Message(const std::string& afilename)
16  :filename(afilename)
17  {}
18  };
20  static eBackgroundFileEraser *instance;
21  void gotMessage(const Message &message);
22  void thread();
23  void idle();
24  ePtr<eTimer> stop_thread_timer;
25  off_t erase_speed;
26  int erase_flags;
27 #ifndef SWIG
28 public:
29 #endif
32 #ifdef SWIG
33 public:
34 #endif
35  void erase(const std::string& filename);
36  void setEraseSpeed(int inMBperSecond);
37  void setEraseFlags(int flags);
38  static eBackgroundFileEraser *getInstance() { return instance; }
39  static const int ERASE_FLAG_HDD = 1;
40  static const int ERASE_FLAG_OTHER = 2;
41 };
42 
43 #endif
Definition: file_eraser.h:9
void setEraseSpeed(int inMBperSecond)
Definition: file_eraser.cpp:145
void erase(const std::string &filename)
Definition: file_eraser.cpp:57
~eBackgroundFileEraser()
Definition: file_eraser.cpp:32
eBackgroundFileEraser()
Definition: file_eraser.cpp:15
void setEraseFlags(int flags)
Definition: file_eraser.cpp:152
static eBackgroundFileEraser * getInstance()
Definition: file_eraser.h:38
static const int ERASE_FLAG_OTHER
Definition: file_eraser.h:40
static const int ERASE_FLAG_HDD
Definition: file_eraser.h:39
Definition: ebase.h:187
Definition: thread.h:27
const char * filename
Definition: epng.h:36