Encapsulate a chat event.
More...
#include <SimpleChatServer.h>
Encapsulate a chat event.
Definition at line 30 of file SimpleChatServer.h.
◆ Type
Enumeration for the event type.
Enumerator |
---|
Login | |
Logout | |
Rename | |
Message | |
Definition at line 35 of file SimpleChatServer.h.
◆ ChatEvent() [1/2]
Definition at line 69 of file SimpleChatServer.h.
71 { }
const Wt::WString & message() const
Get the message of the event.
const Wt::WString & user() const
Get the user who caused the event.
◆ ChatEvent() [2/2]
Definition at line 73 of file SimpleChatServer.h.
76 { }
Type type() const
Get the event type.
const Wt::WString & data() const
Get the extra data for this event.
◆ 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 15 of file SimpleChatServer.C.
17{
27 + " logged out.</span>";
29 return "<span class='chat-info'>"
31 "You are" :
36
37 result =
WString(
"<span class='")
39 "chat-self" :
40 "chat-user")
42
45
47 return result + "<span class='chat-highlight'>" + msg + "</span>";
48 else
49 return result + msg;
50 }
51 default:
52 return "";
53 }
54}
static WString fromUTF8(const std::string &value, bool checkValid=false)
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: