Skip to content

Commit 82cfec3

Browse files
authored
Update README.md
1 parent 58ac26b commit 82cfec3

1 file changed

Lines changed: 22 additions & 20 deletions

File tree

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,36 @@ The focus should lie on the code's architecture and efficiency. Therefore the be
77

88
## What's been implemented so far
99
* 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
2221

2322
## File structure
2423
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
2827
```
29-
NextPosition~===========U257460======
28+
NextPosition~===========UID======
3029
Name:Heinrich,Musterman
3130
Books:
3231
BID,DATE,POSITION
3332
BID,DATE,POSITION
33+
-----------------------------------------------------------------------------
3434
Owned:
3535
BID,DATE,POSITION
36+
---------------------------------------------------------------------------------------------------
3637
```
37-
* 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
3840

3941
## Installation and Usage
4042
* 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
4749
Also, don't hesitate to raise new Issues with feature requests or ideas!
4850

4951
### 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 ;)
5254

5355
## 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```.
5557

5658
## Contribution
5759
...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

Comments
 (0)