1
0
mirror of https://github.com/binary-kitchen/doorlockd synced 2024-12-22 18:34:25 +01:00
doorlockd-mirror/doorlockd/lib/clientmessage.h

42 lines
919 B
C
Raw Normal View History

#ifndef CLIENTMESSAGE_H
#define CLIENTMESSAGE_H
#include <string>
#include <json/json.h>
#include "doormessage.h"
class Clientmessage
{
public:
Clientmessage(std::string token,
bool isOpen,
Doormessage doormessage);
2015-10-07 15:54:28 +02:00
Clientmessage();
Clientmessage &operator=(const Clientmessage& rhs);
static Clientmessage fromJson(const Json::Value &root);
static Clientmessage fromString(const std::string &json);
std::string toJson() const;
const std::string& token() const;
bool isOpen() const;
const Doormessage& doormessage() const;
private:
2015-10-07 15:54:28 +02:00
std::string _token;
bool _isOpen;
Doormessage _doormessage;
2015-10-07 15:54:28 +02:00
const static std::string _tokenKey;
const static std::string _unlockButtonKey;
const static std::string _lockButtonKey;
const static std::string _emergencyUnlockKey;
const static std::string _isOpenKey;
};
#endif