Skip to content

Commit

Permalink
Merge pull request #3 from ArthanIRC/initial-message
Browse files Browse the repository at this point in the history
feat: backbones of message class
  • Loading branch information
mortebrume authored Jul 24, 2024
2 parents e88acbc + 5c1a8fb commit 544ca37
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/Message.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

#include <string>

class Message {
private:
std::string _content;

void validate(std::string& data);

public:
Message(std::string& data);
virtual ~Message();

virtual void run() = 0;
};
1 change: 1 addition & 0 deletions make/sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ SOURCES += ./src/Channel.cpp
SOURCES += ./src/Client.cpp
SOURCES += ./src/Command.cpp
SOURCES += ./src/main.cpp
SOURCES += ./src/Message.cpp
SOURCES += ./src/Server.cpp
SOURCES += ./src/SocketClient.cpp
SOURCES += ./src/Socket.cpp
Expand Down
7 changes: 7 additions & 0 deletions src/Message.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "Message.hpp"

Message::Message(std::string& data) { validate(data); }

Message::~Message() {}

void Message::validate(std::string& data) { this->_content = data; }

0 comments on commit 544ca37

Please sign in to comment.