#ifndef TWISTER_UTILS_H #define TWISTER_UTILS_H #include "json/json_spirit.h" #include "libtorrent/entry.hpp" #include #include #include // in-memory unencrypted DMs struct StoredDirectMsg { int64_t m_utcTime; std::string m_text; bool m_fromMe; }; // in-memory data per wallet user struct UserData { std::set m_following; // m_directmsg key is the other username std::map > m_directmsg; }; class twister_utils { public: twister_utils(); }; int load_file(std::string const& filename, std::vector& v, int limit = 8000000); int save_file(std::string const& filename, std::vector& v); json_spirit::Value entryToJson(const libtorrent::entry &e); libtorrent::entry jsonToEntry(const json_spirit::Value &v); int saveUserData(std::string const& filename, std::map const &users); int loadUserData(std::string const& filename, std::map &users); #endif // TWISTER_UTILS_H