You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-20Lines changed: 22 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,36 @@ The focus should lie on the code's architecture and efficiency. Therefore the be
7
7
8
8
## What's been implemented so far
9
9
* A CSV-Parser - featuring a Row, Header, CSVParser, and Error class contained in namespace CSV. The CSV-Parser can be called with a Header Element containing the files structure and a filename to open. If the file does not exist it is created. In case the Header does not match the given header the CSVParser corrects it. Elements inside the CSV file can than be accessed via the .getRow function and the index operators (e.g. [0] or ["SOMEHEADER"])
10
-
* A User Class that takes care of registration, login, and instantiating the Userinfo class with the User's info
11
-
* A Userinfo Class that stores the information regarding a certain UID and provides it for the Library to use
12
-
* A Library Class that features a run_library task - letting the User login, out, and exit
13
-
14
-
## Future Features
15
-
* Rent a book
16
-
* Read a book
17
-
* Show my books
18
-
* List books
19
-
* Buy a book
20
-
* return a book
21
-
* Different User types -> Publisher that can publish books
10
+
* A User Class that takes care of registration, login, and instantiating the Userinfo - it also provides access to all the user related data
11
+
* A Library Class that holds the main loop and provides the basic functions listed below
12
+
13
+
## Features
14
+
* Rent a book -> The function looks up the availability and updates both the userinfo and the inventory
15
+
* Read a book -> still in progress
16
+
* Show my books -> function mainly provided by the userclass which returns a string with all the public infos
17
+
* List books
18
+
* Buy a book -> same as rent a book - this function only writes the book to the `owned` category in userinfo
19
+
* return a book (unavailable)
20
+
* Different User types -> User is fully supported while Publisher is only implemented on a surface level
22
21
23
22
## File structure
24
23
Using SQL for that project would have probably been the smarter way, but that never was the purpose, right?!
25
-
I wanted to have to come up with my own way of organizing data and handling it in my custom-made C++ functions. So here's how I organized the Userinfo:
26
-
* The ```User``` Class reads and writes users in this data/Userfile.csv file in the following order ```USERNAME,PASSWORD,UID``` whereas ```UID``` is a unique 7 letter string with either a 'U', 'A' or 'P' at the beginning (for User, Admin, Publisher) followed by a unique six-digit number
27
-
* The ```UID``` can be found in the data/Userinfo.txt file handled by the ```Userinfo``` class. The information here is presented like this
24
+
I wanted to have to come up with my own way of organizing data and handling it in my own C++ functions in order to refresh my knowledge regarding the reading and writing to a file. So here's how I organized the Userinfo:
25
+
* The ```User``` Class reads and writes users in data/Userfile.csv in the following order ```USERNAME,PASSWORD,UID``` whereas ```UID``` is a unique 7 letter string with either a 'U', 'A' or 'P' at the beginning (for User, Admin, Publisher) followed by a unique six-digit number
26
+
* The ```UID``` can be found in the data/Userinfo.txt file also handled by the ```User``` class. The information here is presented like this
* Finally the ```Library``` Class has access to data/Inventory.csv with this file structure ```BID,NAME,AUTHOR,COPIES,RENTED,LINK```. The ```BID```s mentioned in the Usersinfo match one of the books in the inventory which in return holds the path ```LINK``` to the books file in data/books
38
+
```------``` These serve as space holders making it easier to write to the file since I can simply overwrite them instead of having to create a .tmp copy of the entire file
39
+
* Finally the ```Library``` Class has access to data/Inventory.csv with this file structure ```BID,NAME,AUTHOR,COPIES,RENTED,LINK```. The ```BID```s mentioned in Usersinfo.txt match one of the books in the inventory which in return holds the path (```LINK```) to the books file in data/books
38
40
39
41
## Installation and Usage
40
42
* Download the Code from Github - see Releases for latest Version (I advise you let the data/ folder where it is - no handling included for that yet)
@@ -47,11 +49,11 @@ If you find any type of bug please raise an issue here with all the necessary de
47
49
Also, don't hesitate to raise new Issues with feature requests or ideas!
48
50
49
51
### What to do if nothing works anymore
50
-
Press CTRL+C go into data/ and delete the three database files. On the next startup, the program should simply create new files and it should run again.
51
-
But don't forget to share the issue you ran into with us ;)
52
+
Press CTRL+C go into data/ and delete the Userinfo.txt and Userfile.csv. On the next startup, the program should simply create new files and it should run again.
53
+
But don't forget to share the issue you ran into ;)
52
54
53
55
## Development
54
-
Development happens in feature branches like ```library_feature``` so that the main branch always is funtional. Before the feature branch is ready to merge bugs must be fix in specific bug branches marked with ```iss``` or ```feat```.
56
+
Development happens in feature branches like ```feat69``` so that the main branch always is funtional. Before the feature branch is ready to merge bugs must be fix in specific bug branches marked with ```iss``` or ```bug```.
55
57
56
58
## Contribution
57
59
...always welcome. Please feel free to fork this repo and train your own C++ skills with it! Or if you wish to share your ideas here :) !Note that I will upload Contribution guidelines in the future. So if you want to contribute now please keep in mind the overall structure of the code. Still I'm always up for critic!
0 commit comments