32 lines
715 B
C++
32 lines
715 B
C++
#pragma once
|
|
|
|
#include "config.h"
|
|
#include <exception>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace state {
|
|
class InvalidSavedStateException : std::exception {
|
|
public:
|
|
inline InvalidSavedStateException(const char *message): message(message) {};
|
|
const char *message;
|
|
};
|
|
|
|
struct RepostState {
|
|
long lastLoadedPostDate = 0;
|
|
long lastForwardedPostDate = 0;
|
|
};
|
|
|
|
class AppState {
|
|
public:
|
|
inline AppState() {};
|
|
AppState(std::string filename, config::AppConfig *cfg);
|
|
std::string to_string();
|
|
void save();
|
|
std::vector<RepostState> vkRepostState;
|
|
std::vector<RepostState> tgRepostState;
|
|
private:
|
|
std::string m_saveFilename;
|
|
config::AppConfig *m_config;
|
|
};
|
|
} |