initial
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
project(tw_chat_lib)
|
||||
|
||||
file(GLOB_RECURSE HEADERS
|
||||
include/*.hpp
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME} OBJECT ${HEADERS} ${PROTO_FILES})
|
||||
add_library(tw::chat::lib ALIAS ${PROJECT_NAME})
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
./include/
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE
|
||||
spdlog::spdlog
|
||||
tw::network
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
namespace tw::chat {
|
||||
|
||||
enum class ChatClientError {
|
||||
PermissionDenied,
|
||||
ChannelNotFound,
|
||||
};
|
||||
|
||||
} // namespace tw::chat
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
namespace tw::chat {
|
||||
|
||||
enum class ChatServerError {
|
||||
PermissionDenied,
|
||||
ChannelNotFound,
|
||||
};
|
||||
|
||||
} // namespace tw::chat
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace tw::chat {
|
||||
|
||||
class ChatMessage {
|
||||
public:
|
||||
using Clock = std::chrono::system_clock;
|
||||
using TimePoint = Clock::time_point;
|
||||
|
||||
TimePoint timestamp;
|
||||
|
||||
uint64_t client_id;
|
||||
uint64_t channel_id;
|
||||
std::string message;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user