Encapsulate a chat event.
More...
#include <SimpleChatServer.h>
Encapsulate a chat event.
Definition at line 29 of file SimpleChatServer.h.
◆ Type
Enumeration for the event type.
Enumerator |
---|
Login | |
Logout | |
Rename | |
Message | |
Definition at line 34 of file SimpleChatServer.h.
◆ ChatEvent() [1/2]
Definition at line 68 of file SimpleChatServer.h.
const Wt::WString & user() const
Get the user who caused the event.
const Wt::WString & message() const
Get the message of the event.
◆ ChatEvent() [2/2]
Definition at line 72 of file SimpleChatServer.h.
const Wt::WString & data() const
Get the extra data for this event.
Type type() const
Get the event type.
◆ data()
◆ formattedHTML()
Get the message formatted as HTML, rendered for the given user.
The format
indicates how the message should be formatted.
Definition at line 13 of file SimpleChatServer.C.
19 + Wt::WWebWidget::escapeText(
user_) +
" joined.</span>";
24 Wt::WWebWidget::escapeText(
user_))
25 +
" logged out.</span>";
27 return "<span class='chat-info'>"
30 (Wt::WWebWidget::escapeText(
user_) +
" is"))
31 +
" now known as " + Wt::WWebWidget::escapeText(
data_) +
".</span>";
39 +
"'>" + Wt::WWebWidget::escapeText(
user_) +
":</span>";
45 return result +
"<span class='chat-highlight'>" + msg +
"</span>";
std::string toUTF8() const
◆ message()
◆ type()
Type ChatEvent::type |
( |
| ) |
const |
|
inline |
◆ user()
◆ SimpleChatServer
◆ data_
◆ message_
◆ type_
◆ user_
The documentation for this class was generated from the following files: