Added pseudo code algorithms to make programming faster (Some may have already been integrated)
This commit is contained in:
parent
cf050d1de8
commit
e35c2b8a71
5 changed files with 20 additions and 0 deletions
5
Algorithms/check drive capacity.pseudo
Normal file
5
Algorithms/check drive capacity.pseudo
Normal file
|
@ -0,0 +1,5 @@
|
|||
(USB_Location, Drive_Location)
|
||||
freeSpace <-- getCapacity(Drive_Location)
|
||||
driveFiles <-- getCapacity(USB_Location)
|
||||
if driveFiles > freeSpace then return True
|
||||
else return False
|
4
Algorithms/check drive is recorded.pseudo
Normal file
4
Algorithms/check drive is recorded.pseudo
Normal file
|
@ -0,0 +1,4 @@
|
|||
(DriveFormat, DriveName, DriveCapacity)
|
||||
result <-- ExecuteSQL("SELECT BackupName FROM backups WHERE driveFormat = {} AND DriveName = {} AND DriveCapacity = {};")
|
||||
if results is None then return False
|
||||
Else Return True
|
3
Algorithms/check if compression.pseudo
Normal file
3
Algorithms/check if compression.pseudo
Normal file
|
@ -0,0 +1,3 @@
|
|||
(BackupName, DriveName, DriveCapacity)
|
||||
wantsCompression <-- ExecuteSQL("SELECT isCompressed FROM backupTable WHERE driveName = {} AND BackupName = {} AND DriveCapacity = {}", DriveName, BackupName, DriveCapacity)
|
||||
return wantsCompression
|
3
Algorithms/detect user logged in.pseudo
Normal file
3
Algorithms/detect user logged in.pseudo
Normal file
|
@ -0,0 +1,3 @@
|
|||
add c# user reference
|
||||
username <-- computer.UserName()
|
||||
return username
|
5
Algorithms/has drive changed since backup.pseudo
Normal file
5
Algorithms/has drive changed since backup.pseudo
Normal file
|
@ -0,0 +1,5 @@
|
|||
(backupName, driveLetter)
|
||||
driveHash <-- calculateHash(driveLetter)
|
||||
backupHash = ExecuteSQL("SELECT Hash FROM Backups WHERE backupName = {}", backupName)
|
||||
if backupName is driveHash then return False
|
||||
Else return True
|
Reference in a new issue