-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob set.cpp
executable file
·46 lines (37 loc) · 1.5 KB
/
job set.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Include statements
#include <windows.h>
#include <windef.h>
#include <atlstr.h>
#include <shlobj.h>
#include "resource.h"
#include "program.h"
#include "class.h"
#include "function.h"
// Global objects
extern handleitem Handle;
extern jobitem Job;
// Update text that describes what the job is doing right now
// Returns the text you give it so you can log it as an error
string JobTask(read r) { sectionitem section;
Job.task = r;
return r;
}
// Count one more file, folder, or compare processed or error
void JobFileCount() { sectionitem section; Job.file++; }
void JobFileError(read r) { sectionitem section; Job.fileerror++; JobError(r); }
void JobFolderCount() { sectionitem section; Job.folder++; }
void JobFolderError(read r) { sectionitem section; Job.foldererror++; JobError(r); }
void JobCompareCount() { sectionitem section; Job.compare++; }
void JobCompareError(read r) { sectionitem section; Job.compareerror++; JobError(r); }
// Record an error
void JobError(read r) { sectionitem section;
// Count the error
Job.error++;
// Make a line of text with the error
string s = make(r, L"\r\n");
// Show the first 1000 errors on the screen
if (Job.error <= STOPERRORS) Job.errors += s;
if (Job.error == STOPERRORS) Job.errors += L"Additional errors in log file\r\n"; // Also make a note for the 1000th error
// Write all the errors to the log file
LogAppend(Job.log, s);
}