#ifndef _KFWEBSOCKETMESSAGE_H
#define _KFWEBSOCKETMESSAGE_H



#include <string>

#include "KfWebSocketConnection.h"
#include "websocketpp/connection.hpp"
#include "websocketpp/config/asio.hpp"

class KfWebSocketMessage;

typedef websocketpp::connection<websocketpp::config::asio>::message_ptr WSMessagePtr;
typedef KfWebSocketMessage* KfWebSocketMessagePtr;

class KfWebSocketMessage {

public:
    KfWebSocketMessage(const WSMessagePtr& message);
    KfWebSocketMessage(const KfWebSocketMessage& copy);

    virtual void KF_CALLCONV setCompressed(const bool& isCompressed);
    virtual void KF_CALLCONV setFin(const bool& isFin);
    virtual void KF_CALLCONV setHeader(const char* header);
    virtual void KF_CALLCONV setOpcode(const KfWebSocketConnection::OpCode& opcode);
    virtual void KF_CALLCONV setPayload(const char* payload);
    virtual void KF_CALLCONV appendPayload(const char* payload);

    virtual bool KF_CALLCONV isCompressed() const;
    virtual bool KF_CALLCONV isFin() const;
    virtual bool KF_CALLCONV isPrepared() const;
    virtual std::string KF_CALLCONV getExtensionData() const;
    virtual std::string KF_CALLCONV getHeader() const;
    virtual std::string KF_CALLCONV getPayload() const;
    virtual std::string KF_CALLCONV getRawPayload() const;
    virtual KfWebSocketConnection::OpCode KF_CALLCONV getOpcode() const;

private:
    WSMessagePtr m_message;

};

#endif // _KFWEBSOCKETMESSAGE_H
