added feature to start shredding for all drives

This commit is contained in:
2022-08-20 16:09:40 +02:00
parent 9863c5591e
commit e3aefb24ee
7 changed files with 55 additions and 21 deletions

View File

@ -22,12 +22,13 @@ public:
FROZEN
} state;
struct {
struct
{
time_t u32ShredTimeDelta;
std::chrono::time_point<std::chrono::system_clock> chronoShredTimestamp;
unsigned long ulWrittenBytes;
} sShredSpeed;
bool bWasShredded = false;
bool bWasDeleteted = false;
bool bIsOffline = false;

View File

@ -64,6 +64,8 @@ using namespace std;
#include "tui.h"
#include "logger/logger.h"
#include "chunk.h"
extern Logger* logging;
template <typename T, typename I> T* iterator_to_pointer(I i)
@ -83,12 +85,13 @@ private:
static void searchDrives(list <Drive>* plistDrives);
static void printDrives(list <Drive>* plistDrives);
static void filterIgnoredDrives(list <Drive>* plistDrives);
static void startShredAllDrives(list <Drive>* plistDrives);
static void filterIgnoredDrives(list <Drive>* plistDrives);
static void filterNewDrives(list <Drive>* plistOldDrives, list <Drive>* plistNewDrives);
static void addSMARTData(list <Drive>* plistDrives);
static void ThreadScannDevices();
static void ThreadUserInput();
static void ThreadShred();
static void ThreadShred(Drive* const pDrive);
static void ThreadDelete();
static void ThreadCheckFrozenDrives();
static void handleArrowKey(TUI::UserInput userInput);

View File

@ -22,7 +22,7 @@
//#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB
//#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB
//#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB
typedef int fileDescriptor;

View File

@ -22,7 +22,7 @@ protected:
public:
enum UserInput { UpKey, DownKey, Abort, Shred, Delete, Enter, ESC, Undefined};
enum UserInput { UpKey, DownKey, Abort, Shred, ShredAll, Delete, Enter, ESC, Undefined};
struct MenuState
{
bool bAbort;