ReactOS 0.4.15-dev-7889-g76290a6
Defragment.h
Go to the documentation of this file.
1/*****************************************************************************
2
3 Defragment
4
5*****************************************************************************/
6
7
8#ifndef DEFRAGMENT_H
9#define DEFRAGMENT_H
10
11
12#include "Unfrag.h"
13#include "DriveVolume.h"
14#include "Mutex.h"
15
16
17extern int FitName (wchar_t *destination, const wchar_t *path, const wchar_t *filename, uint32 totalWidth);
18
19
20typedef struct DefragReport
21{
22 wstring RootPath;
31 double AverageFragments; // = FilesFragments / FilesCount
34
35 vector<uint32> FraggedFiles;
36 vector<uint32> UnfraggedFiles;
37 vector<uint32> UnmovableFiles;
39
40
42{
43public:
45 ~Defragment ();
46
47 // Commands
48 void Start (void);
49 void TogglePause (void);
50 void Stop (void);
51
52 // Info
53 bool IsDoneYet (void);
54 bool HasError (void);
55 wstring GetStatusString (void);
56 double GetStatusPercent (void);
57 DefragType GetDefragType (void) { return (Method); }
58 DefragReport &GetDefragReport (void) { return (Report); }
59 DriveVolume &GetVolume (void) { return (Volume); }
60
61 // Mutex
62 void Lock (void) { DefragMutex.Lock (); }
63 void Unlock (void) { DefragMutex.Unlock (); }
64
65 // Limit length of status string to 70 chars?
66 bool GetDoLimitLength (void) { return (DoLimitLength); }
67 void SetDoLimitLength (bool L) { DoLimitLength = L; }
68
69private:
70 void FastDefrag (void);
71 void ExtensiveDefrag (void);
72 void SetStatusString (wstring NewStatus);
73
74 DWORD LastBMPUpdate; // Last time volume bitmap was updated
78 wstring DriveName;
80 wstring StatusString;
81 wstring ErrorString;
84 bool Error;
85 bool Done;
89};
90
91
92#endif // DEFRAGMENT_H
int FitName(wchar_t *destination, const wchar_t *path, const wchar_t *filename, uint32 totalWidth)
Definition: Defragment.cpp:9
DefragType
Definition: Unfrag.h:67
unsigned int uint32
Definition: types.h:32
void TogglePause(void)
Definition: Defragment.cpp:432
DriveVolume Volume
Definition: Defragment.h:79
void Unlock(void)
Definition: Defragment.h:63
bool Done
Definition: Defragment.h:85
DefragReport & GetDefragReport(void)
Definition: Defragment.h:58
DWORD LastBMPUpdate
Definition: Defragment.h:74
bool GetDoLimitLength(void)
Definition: Defragment.h:66
void ExtensiveDefrag(void)
DriveVolume & GetVolume(void)
Definition: Defragment.h:59
Mutex DefragMutex
Definition: Defragment.h:83
wstring ErrorString
Definition: Defragment.h:81
bool IsDoneYet(void)
Definition: Defragment.cpp:151
bool PleaseStop
Definition: Defragment.h:86
void FastDefrag(void)
wstring DriveName
Definition: Defragment.h:78
DefragReport Report
Definition: Defragment.h:75
void Lock(void)
Definition: Defragment.h:62
bool PleasePause
Definition: Defragment.h:87
void Start(void)
Definition: Defragment.cpp:157
bool Error
Definition: Defragment.h:84
DefragType Method
Definition: Defragment.h:77
bool DoLimitLength
Definition: Defragment.h:76
wstring GetStatusString(void)
Definition: Defragment.cpp:133
DefragType DefragMethod
Definition: Defragment.h:88
void Stop(void)
Definition: Defragment.cpp:443
void SetDoLimitLength(bool L)
Definition: Defragment.h:67
DefragType GetDefragType(void)
Definition: Defragment.h:57
double StatusPercent
Definition: Defragment.h:82
void SetStatusString(wstring NewStatus)
Definition: Defragment.cpp:123
wstring StatusString
Definition: Defragment.h:80
bool HasError(void)
Definition: Defragment.cpp:454
double GetStatusPercent(void)
Definition: Defragment.cpp:145
Definition: Mutex.h:16
void Unlock(void)
Definition: Mutex.h:52
void Lock(void)
Definition: Mutex.h:43
unsigned long long uint64
Definition: platform.h:18
unsigned long DWORD
Definition: ntddk_ex.h:95
const char * filename
Definition: ioapi.h:137
#define L(x)
Definition: ntvdm.h:50
uint64 FilesSizeOnDisk
Definition: Defragment.h:27
uint64 FilesSizeClusters
Definition: Defragment.h:28
vector< uint32 > UnmovableFiles
Definition: Defragment.h:37
double PercentSlack
Definition: Defragment.h:33
vector< uint32 > UnfraggedFiles
Definition: Defragment.h:36
double PercentFragged
Definition: Defragment.h:32
vector< uint32 > FraggedFiles
Definition: Defragment.h:35
uint32 FilesFragments
Definition: Defragment.h:30
uint64 FilesSlackBytes
Definition: Defragment.h:29
uint64 FilesCount
Definition: Defragment.h:25
wstring RootPath
Definition: Defragment.h:22
uint64 FilesSizeBytes
Definition: Defragment.h:26
uint64 DirsCount
Definition: Defragment.h:24
double AverageFragments
Definition: Defragment.h:31
uint64 DiskSizeBytes
Definition: Defragment.h:23