S_New4/accountManager.h
2019-07-08 20:17:11 +02:00

33 lines
680 B
C++

#ifndef ACCOUNTMANAGER_H
#define ACCOUNTMANAGER_H
#include <iostream>
#include <vector>
#include <sys/stat.h>
#include <fstream>
struct Account {
std::string Email, Password;
};
class AccountManager
{
public:
AccountManager(std::string pathToFile, std::string pathToAccountNumberFile);
Account getNextAccount();
int writeDefault(std::string path);
size_t getLastAccountNumber();
int setLastAccountNumber(size_t number);
bool isDirExist(const std::string& path);
bool createDir(std::string path, std::string atLinux = "-p ");
private:
std::vector<Account> accounts;
std::string pathToAccountNumberFile;
};
#endif // ACCOUNTMANAGER_H