S_New4/accountManager.h

33 lines
680 B
C
Raw Normal View History

2019-07-06 18:47:29 +00:00
#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:
2019-07-08 18:17:11 +00:00
AccountManager(std::string pathToFile, std::string pathToAccountNumberFile);
2019-07-06 18:47:29 +00:00
Account getNextAccount();
2019-07-08 18:17:11 +00:00
int writeDefault(std::string path);
size_t getLastAccountNumber();
int setLastAccountNumber(size_t number);
2019-07-06 18:47:29 +00:00
bool isDirExist(const std::string& path);
bool createDir(std::string path, std::string atLinux = "-p ");
private:
std::vector<Account> accounts;
2019-07-08 18:17:11 +00:00
std::string pathToAccountNumberFile;
2019-07-06 18:47:29 +00:00
};
#endif // ACCOUNTMANAGER_H