reHDD/include/drive.h

74 lines
1.7 KiB
C++

/**
* @file drive.h
* @brief represent physical drive
* @author hendrik schutter
* @date 01.05.2020
*/
#ifndef DRIVE_H_
#define DRIVE_H_
#include "reHDD.h"
class Drive
{
public:
enum TaskState {NONE,
SHRED_SELECTED,
SHRED_ACTIVE,
DELETE_SELECTED,
DELETE_ACTIVE
} state;
bool bWasShredded = false;
bool bWasDeleteted = false;
private:
string sPath;
string sModelFamily;
string sModelName;
string sSerial;
uint64_t u64Capacity = 0U; //in byte
uint32_t u32ErrorCount = 0U;
uint32_t u32PowerOnHours = 0U; //in hours
uint32_t u32PowerCycles = 0U;
uint8_t u8TaskPercentage = 0U; //in percent for Shred (1 to 100)
protected:
public:
Drive(string path)
{
this->sPath = path;
}
string getPath(void);
string getModelFamily(void);
string getModelName(void);
string getSerial(void);
uint64_t getCapacity(void); //in byte
uint32_t getErrorCount(void);
uint32_t getPowerOnHours(void); //in hours
uint32_t getPowerCycles(void);
void setDriveSMARTData( string modelFamily,
string modelName,
string serial,
uint64_t capacity,
uint32_t errorCount,
uint32_t powerOnHours,
uint32_t powerCycles);
string sCapacityToText();
string sErrorCountToText();
string sPowerOnHoursToText();
string sPowerCyclesToText();
void setTaskPercentage(uint8_t u8TaskPercentage);
uint8_t getTaskPercentage(void);
};
#endif // DRIVE_H_