aboutsummaryrefslogtreecommitdiff
path: root/src/Message.cpp
blob: 58b39da730d9570b2f6644e88515371913296403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "../include/sibs/Message.hpp"

namespace sibs
{
    Message::Message(MessageType messageType)
    {
        static_assert(sizeof(MessageType) == sizeof(u8), "Whoops, message type size has changed, the below code doesn't work");
        rawData.push_back((u8)messageType);
    }

     void Message::append(const void *data, const usize size)
     {
         rawData.insert(rawData.end(), (const u8*)data, (const u8*)data + size);
     }
}