Persistance is ensured with file based storage, using two .dta files. The application will input data from these files when the program starts, allowing the user to have previously recorded data registered. When the application is closed correctly from the main menu, it will output all data back to these files.
The .dta files are as following:
Resultater.dta
'Resultater.dta' stores the results from previous tournaments. The format is a follows:
<Amount of finished tournaments>
<Amount of tournament wins> <Team name>
The first value is an int representing the amount of teams that has won at least one tournament. Each following line after this will represent one team each, and the amount of times they have won a tournament.
Example:
2
3 Sarpsborg 08
1 Manchester United
Users.dta
'Users.dta' stores the login information and permissions. It has the following format:
<Permission> <Username>
<Password>
Data for each user is stored in two lines. Permissions is read first, with a 1 representing admin permission, and a 0 representing regular permission. Then the username is read from the first line, before the password is read on the second line.
Example:
1 Adminuser
Adminpassword
0 Regularuser
Regularpassword