S_New4/accountManager.h

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