1
0
Fork 0
mirror of https://gitlab.com/niansa/qcommsy.git synced 2025-03-06 20:53:33 +01:00
qcommsy/libcommsy.hpp
2020-09-02 22:05:29 +02:00

51 lines
1.1 KiB
C++

#include <string>
#include <vector>
#include <exception>
namespace taskState {
enum type {none, done, inProgress, todo};
}
struct commsyFile {
std::string name;
std::string url;
};
struct commsyPost {
std::string name;
std::string id;
std::string description = "\xFF";
std::string meta;
std::string url;
bool unread;
taskState::type taskState;
std::vector<commsyFile> files;
};
#define libCommsy_NAME "libcommsy"
#define libCommsy_VERSION "1.4-stable"
class libCommsy {
public:
std::vector<commsyPost> posts;
unsigned long numposts;
std::string lastID;
std::string server_url;
std::string server_sid;
bool postExists(unsigned long postID);
commsyPost *getPost(unsigned long postID);
std::string *getDescription(unsigned long postID);
libCommsy(const std::string& _server_url, const std::string& _server_sid, const std::string& _room, const std::string start_id = "", const unsigned long max_posts = 0);
// Exceptions
class invalidSIDError {};
class invalidRoomError {};
class invalidPostError {};
class connectionFailError {};
};