<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Wt examples: ChatEvent Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Wt examples  <span id="projectnumber">3.2.3</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="#pri-methods">Private Member Functions</a> | <a href="#pri-attribs">Private Attributes</a> | <a href="#friends">Friends</a> </div> <div class="headertitle"> <div class="title">ChatEvent Class Reference<div class="ingroups"><a class="el" href="group__chatexample.html">Chat example</a></div></div> </div> </div> <div class="contents"> <!-- doxytag: class="ChatEvent" --> <p>Encapsulate a chat event. <a href="classChatEvent.html#details">More...</a></p> <p><code>#include <<a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>></code></p> <p><a href="classChatEvent-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-types"></a> Public Types</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> { <a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6">Login</a>, <a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171">Logout</a>, <a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8">Rename</a>, <a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Enumeration for the event type. <a href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">More...</a><br/></td></tr> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#ac932234e63d23080f4f91f7ae1167418">type</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the event type. <a href="#ac932234e63d23080f4f91f7ae1167418"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#adbeff19aece69e75ab0b69f2adecc5b6">user</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the user who caused the event. <a href="#adbeff19aece69e75ab0b69f2adecc5b6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a1e73c4e7d9a59d790d4ba3a5bb36902d">message</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the message of the event. <a href="#a1e73c4e7d9a59d790d4ba3a5bb36902d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a7a16dc199e1da813b8fc6bc155dc04e2">data</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the extra data for this event. <a href="#a7a16dc199e1da813b8fc6bc155dc04e2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a459911a1ba1c3e793c6c797e534691b7">formattedHTML</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &user, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/namespaceWt.html#a140dea437d52d3d7c438ea3bd16a1480">Wt::TextFormat</a> format) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get the message formatted as HTML, rendered for the given user. <a href="#a459911a1ba1c3e793c6c797e534691b7"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pri-methods"></a> Private Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a87e8c95da862b11466c9de1c9039cf6b">ChatEvent</a> (const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &user, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &message)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a78a7f54e8a39eb3448197461bcc7b125">ChatEvent</a> (<a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> type, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &user, const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> &data=<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a511a12bce677dc733bd7b6b9415bff73">Wt::WString::Empty</a>)</td></tr> <tr><td colspan="2"><h2><a name="pri-attribs"></a> Private Attributes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a></td></tr> <tr><td colspan="2"><h2><a name="friends"></a> Friends</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classChatEvent.html#ac99c17370c25b3c92dbb0578e4298ade">SimpleChatServer</a></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Encapsulate a chat event. </p> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00030">30</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> </div><hr/><h2>Member Enumeration Documentation</h2> <a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61"></a><!-- doxytag: member="ChatEvent::Type" ref="afa84446dae17c08fe15cf932fc0b7d61" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">ChatEvent::Type</a></td> </tr> </table> </div> <div class="memdoc"> <p>Enumeration for the event type. </p> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6"></a><!-- doxytag: member="Login" ref="afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6" args="" -->Login</em> </td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171"></a><!-- doxytag: member="Logout" ref="afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171" args="" -->Logout</em> </td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8"></a><!-- doxytag: member="Rename" ref="afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8" args="" -->Rename</em> </td><td> </td></tr> <tr><td valign="top"><em><a class="anchor" id="afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1"></a><!-- doxytag: member="Message" ref="afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1" args="" -->Message</em> </td><td> </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00035">35</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> <div class="fragment"><pre class="fragment">{ <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6">Login</a>, <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171">Logout</a>, <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8">Rename</a>, <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a> }; </pre></div> </div> </div> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a87e8c95da862b11466c9de1c9039cf6b"></a><!-- doxytag: member="ChatEvent::ChatEvent" ref="a87e8c95da862b11466c9de1c9039cf6b" args="(const Wt::WString &user, const Wt::WString &message)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">ChatEvent::ChatEvent </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td> <td class="paramname"><em>message</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline, private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00069">69</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> <div class="fragment"><pre class="fragment"> : <a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>(<a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a>), <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>(user), <a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>(message) { } </pre></div> </div> </div> <a class="anchor" id="a78a7f54e8a39eb3448197461bcc7b125"></a><!-- doxytag: member="ChatEvent::ChatEvent" ref="a78a7f54e8a39eb3448197461bcc7b125" args="(Type type, const Wt::WString &user, const Wt::WString &data=Wt::WString::Empty)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">ChatEvent::ChatEvent </td> <td>(</td> <td class="paramtype"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> </td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td> <td class="paramname"><em>data</em> = <code><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a511a12bce677dc733bd7b6b9415bff73">Wt::WString::Empty</a></code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline, private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00073">73</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> <div class="fragment"><pre class="fragment"> : <a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>(<a class="code" href="classChatEvent.html#ac932234e63d23080f4f91f7ae1167418" title="Get the event type.">type</a>), <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>(user), <a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a>(data) { } </pre></div> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a7a16dc199e1da813b8fc6bc155dc04e2"></a><!-- doxytag: member="ChatEvent::data" ref="a7a16dc199e1da813b8fc6bc155dc04e2" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>& ChatEvent::data </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the extra data for this event. </p> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00051">51</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a>; } </pre></div> </div> </div> <a class="anchor" id="a459911a1ba1c3e793c6c797e534691b7"></a><!-- doxytag: member="ChatEvent::formattedHTML" ref="a459911a1ba1c3e793c6c797e534691b7" args="(const Wt::WString &user, Wt::TextFormat format) const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> ChatEvent::formattedHTML </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/namespaceWt.html#a140dea437d52d3d7c438ea3bd16a1480">Wt::TextFormat</a> </td> <td class="paramname"><em>format</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </div> <div class="memdoc"> <p>Get the message formatted as HTML, rendered for the given user. </p> <p>The <code>format</code> indicates how the message should be formatted. </p> <p>Definition at line <a class="el" href="SimpleChatServer_8C_source.html#l00015">15</a> of file <a class="el" href="SimpleChatServer_8C_source.html">SimpleChatServer.C</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">switch</span> (<a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>) { <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61a5173cb4baa818f95af4604d7a01e3ae6">Login</a>: <span class="keywordflow">return</span> WString::fromUTF8(<span class="stringliteral">"<span class='chat-info'>"</span>) + WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) + <span class="stringliteral">" joined.</span>"</span>; <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61aa8b11c1512738c200b2cfe1facd1c171">Logout</a>: <span class="keywordflow">return</span> WString::fromUTF8(<span class="stringliteral">"<span class='chat-info'>"</span>) + ((user == <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) ? WString::fromUTF8(<span class="stringliteral">"You"</span>) : WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>)) + <span class="stringliteral">" logged out.</span>"</span>; <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab168d89affa0c72ba9a37d2881479ed8">Rename</a>: <span class="keywordflow">return</span> <span class="stringliteral">"<span class='chat-info'>"</span> + ((user == <a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a> || user == <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) ? <span class="stringliteral">"You are"</span> : (WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) + <span class="stringliteral">" is"</span>)) + <span class="stringliteral">" now known as "</span> + WWebWidget::escapeText(<a class="code" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">data_</a>) + <span class="stringliteral">".</span>"</span>; <span class="keywordflow">case</span> <a class="code" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61ab8894351cd11a316e25495f677eb9ae1">Message</a>:{ <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> result; result = <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a>(<span class="stringliteral">"<span class='"</span>) + ((user == <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) ? <span class="stringliteral">"chat-self"</span> : <span class="stringliteral">"chat-user"</span>) + <span class="stringliteral">"'>"</span> + WWebWidget::escapeText(<a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>) + <span class="stringliteral">":</span>"</span>; <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">WString</a> msg = (format == <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/namespaceWt.html#a140dea437d52d3d7c438ea3bd16a1480a847ab5a73b906fea275bd16877b420a4">XHTMLText</a> ? <a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a> : WWebWidget::escapeText(<a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>)); <span class="keywordflow">if</span> (<a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a159d088da6e8f2be1035b2341889254c">toUTF8</a>().find(user.<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html#a159d088da6e8f2be1035b2341889254c">toUTF8</a>()) != std::string::npos) <span class="keywordflow">return</span> result + <span class="stringliteral">"<span class='chat-highlight'>"</span> + msg + <span class="stringliteral">"</span>"</span>; <span class="keywordflow">else</span> <span class="keywordflow">return</span> result + msg; } <span class="keywordflow">default</span>: <span class="keywordflow">return</span> <span class="stringliteral">""</span>; } } </pre></div> </div> </div> <a class="anchor" id="a1e73c4e7d9a59d790d4ba3a5bb36902d"></a><!-- doxytag: member="ChatEvent::message" ref="a1e73c4e7d9a59d790d4ba3a5bb36902d" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>& ChatEvent::message </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the message of the event. </p> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00047">47</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">message_</a>; } </pre></div> </div> </div> <a class="anchor" id="ac932234e63d23080f4f91f7ae1167418"></a><!-- doxytag: member="ChatEvent::type" ref="ac932234e63d23080f4f91f7ae1167418" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> ChatEvent::type </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the event type. </p> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00039">39</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">type_</a>; } </pre></div> </div> </div> <a class="anchor" id="adbeff19aece69e75ab0b69f2adecc5b6"></a><!-- doxytag: member="ChatEvent::user" ref="adbeff19aece69e75ab0b69f2adecc5b6" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a>& ChatEvent::user </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get the user who caused the event. </p> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00043">43</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> <div class="fragment"><pre class="fragment">{ <span class="keywordflow">return</span> <a class="code" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">user_</a>; } </pre></div> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="ac99c17370c25b3c92dbb0578e4298ade"></a><!-- doxytag: member="ChatEvent::SimpleChatServer" ref="ac99c17370c25b3c92dbb0578e4298ade" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">friend class <a class="el" href="classSimpleChatServer.html">SimpleChatServer</a><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00078">78</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> </div> </div> <hr/><h2>Member Data Documentation</h2> <a class="anchor" id="af24b35a3833777adff7e149383225e41"></a><!-- doxytag: member="ChatEvent::data_" ref="af24b35a3833777adff7e149383225e41" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> <a class="el" href="classChatEvent.html#af24b35a3833777adff7e149383225e41">ChatEvent::data_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00063">63</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> </div> </div> <a class="anchor" id="ad51677c773550286593db4793dae62eb"></a><!-- doxytag: member="ChatEvent::message_" ref="ad51677c773550286593db4793dae62eb" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> <a class="el" href="classChatEvent.html#ad51677c773550286593db4793dae62eb">ChatEvent::message_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00064">64</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> </div> </div> <a class="anchor" id="a8a55c20da17f812694469924b04bfd4c"></a><!-- doxytag: member="ChatEvent::type_" ref="a8a55c20da17f812694469924b04bfd4c" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classChatEvent.html#afa84446dae17c08fe15cf932fc0b7d61">Type</a> <a class="el" href="classChatEvent.html#a8a55c20da17f812694469924b04bfd4c">ChatEvent::type_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00061">61</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> </div> </div> <a class="anchor" id="a3e2d08dca6b95343ad494e796a320eec"></a><!-- doxytag: member="ChatEvent::user_" ref="a3e2d08dca6b95343ad494e796a320eec" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WString.html">Wt::WString</a> <a class="el" href="classChatEvent.html#a3e2d08dca6b95343ad494e796a320eec">ChatEvent::user_</a><code> [private]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Definition at line <a class="el" href="SimpleChatServer_8h_source.html#l00062">62</a> of file <a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>/home/koen/project/wt/public-git/wt/examples/simplechat/<a class="el" href="SimpleChatServer_8h_source.html">SimpleChatServer.h</a></li> <li>/home/koen/project/wt/public-git/wt/examples/simplechat/<a class="el" href="SimpleChatServer_8C_source.html">SimpleChatServer.C</a></li> </ul> </div> <hr size="1"><address style="text-align: right; margin: 3px"><small> Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the C++ Web Toolkit (Wt)</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" border="0" style="vertical-align: middle; display: inline-block; height: 2em"></a> 1.7.5.1</small></address> </body> </html>