reHDD/include/reHDD.h

70 lines
1.3 KiB
C
Raw Normal View History

/**
2020-05-02 22:06:47 +02:00
* @file reHDD.h
* @brief represent
* @author hendrik schutter
* @date 01.05.2020
*/
2020-05-02 22:06:47 +02:00
#ifndef REHDD_H_
#define REHDD_H_
2020-08-04 19:51:34 +02:00
#define DRYRUN
2020-08-07 16:17:45 +02:00
#define WORSE_HOURS 19200 //mark drive if at this limit or beyond
#define WORSE_POWERUP 4000 //mark drive if at this limit or beyond
2020-05-02 22:06:47 +02:00
#include <iostream>
#include <string>
#include <fstream>
#include <tuple>
#include <vector>
2020-05-03 17:17:20 +02:00
#include <time.h>
#include <chrono>
2020-08-03 22:40:07 +02:00
#include <curses.h>
2020-08-04 17:18:32 +02:00
#include <thread>
2020-08-03 22:40:07 +02:00
#include <unistd.h>
2020-08-04 11:59:45 +02:00
#include <mutex>
#include <sys/select.h>
2020-08-04 17:18:32 +02:00
#include<algorithm>
2020-08-04 22:35:29 +02:00
#include <cstring>
2020-08-07 13:17:52 +02:00
#include <sstream>
#include <iomanip>
2020-08-04 11:59:45 +02:00
2020-05-02 22:06:47 +02:00
using namespace std;
#include "drive.h"
2020-05-02 00:49:11 +02:00
#include "smart.h"
2020-05-03 17:17:20 +02:00
#include "wipe.h"
2020-08-04 22:35:29 +02:00
#include "tui.h"
2020-05-02 22:06:47 +02:00
template <typename T, typename I> T* iterator_to_pointer(I i)
{
return (&(*i));
}
2020-08-04 11:59:45 +02:00
2020-05-02 22:06:47 +02:00
class reHDD
{
protected:
public:
2020-05-02 22:06:47 +02:00
reHDD(void);
void app_logic();
private:
2020-08-04 17:18:32 +02:00
static void searchDrives(vector <Drive>* pvecDrives);
2020-08-04 11:59:45 +02:00
static void printDrives(vector <Drive>* pvecDrives);
2020-08-04 17:18:32 +02:00
static void filterIgnoredDrives(vector <Drive>* pvecDrives);
2020-08-04 11:59:45 +02:00
static void addSMARTData(vector <Drive>* pvecDrives);
static void ThreadScannDevices();
2020-08-07 12:07:29 +02:00
static void ThreadUserInput();
static void handleArrowKey(TUI::UserInput userInput);
static void filterNewDrives(vector <Drive>* pvecOldDrives, vector <Drive>* pvecNewDrives);
2020-08-03 22:40:07 +02:00
};
2020-05-02 22:06:47 +02:00
#endif // REHDD_H_