Website Summary Files Commits Branches @commit @diff @stats
path: root / Utills / Kindle / User.cpp
blob: df1cea576915a6427ddd1b19546da7aa76b9140b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "User.h"

User::User(const string& pName, const string& pPassword) {
	name = pName;
	password = pPassword;
}

void User::writeToFile(std::ofstream& outFile) const {
	writeString(outFile, name);
	writeString(outFile, password);

	writeVector(outFile, indexesOfBooksRead);
	writeVector(outFile, indexesOfBooksWritten);
}

void User::readFromFile(std::ifstream& inFile) {
	name = readString(inFile);
	password = readString(inFile);

	indexesOfBooksRead = readVector(inFile);
	indexesOfBooksWritten = readVector(inFile);
}