Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 64

wt-doc-3.2.3-1.fc18.noarch.rpm

<!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: /home/koen/project/wt/public-git/wt/examples/wt-homepage/ExampleSourceViewer.C File 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
   &#160;<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&#160;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><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">/home/koen/project/wt/public-git/wt/examples/wt-homepage/ExampleSourceViewer.C File Reference</div>  </div>
</div>
<div class="contents">
<div class="textblock"><code>#include &lt;iostream&gt;</code><br/>
<code>#include &lt;stdlib.h&gt;</code><br/>
<code>#include &lt;algorithm&gt;</code><br/>
<code>#include &lt;Wt/WApplication&gt;</code><br/>
<code>#include &lt;Wt/WContainerWidget&gt;</code><br/>
<code>#include &lt;Wt/WEnvironment&gt;</code><br/>
<code>#include &lt;Wt/WLineEdit&gt;</code><br/>
<code>#include &lt;Wt/WGridLayout&gt;</code><br/>
<code>#include &lt;Wt/WHBoxLayout&gt;</code><br/>
<code>#include &lt;Wt/WPushButton&gt;</code><br/>
<code>#include &lt;Wt/WTable&gt;</code><br/>
<code>#include &lt;Wt/WText&gt;</code><br/>
<code>#include &lt;Wt/WTreeView&gt;</code><br/>
<code>#include &lt;Wt/WVBoxLayout&gt;</code><br/>
<code>#include &lt;Wt/WViewWidget&gt;</code><br/>
<code>#include &lt;boost/filesystem/operations.hpp&gt;</code><br/>
<code>#include &lt;boost/filesystem/exception.hpp&gt;</code><br/>
<code>#include &lt;boost/filesystem/convenience.hpp&gt;</code><br/>
<code>#include &lt;boost/algorithm/string.hpp&gt;</code><br/>
<code>#include &quot;<a class="el" href="ExampleSourceViewer_8h_source.html">ExampleSourceViewer.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="FileItem_8h_source.html">FileItem.h</a>&quot;</code><br/>
</div>
<p><a href="ExampleSourceViewer_8C_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ExampleSourceViewer_8C.html#a90d62aee81b34c117b8f494a54bee4d4">filename</a> (const fs::path &amp;p)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ExampleSourceViewer_8C.html#a2fb90126657b786f14062b06f995583c">stem</a> (const fs::path &amp;p)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">fs::path&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ExampleSourceViewer_8C.html#ae19c9a4a8bd0a5e02a00d6e17707a342">parent_path</a> (const fs::path &amp;p)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ExampleSourceViewer_8C.html#acb92ccbf2405b113c0b8b66cec63aaae">comparePaths</a> (const fs::path &amp;p1, const fs::path &amp;p2)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static fs::path&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="ExampleSourceViewer_8C.html#a0c61a4a8c171f6b23a9fc3872c2e9e5d">getCompanion</a> (const fs::path &amp;path)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="acb92ccbf2405b113c0b8b66cec63aaae"></a><!-- doxytag: member="ExampleSourceViewer.C::comparePaths" ref="acb92ccbf2405b113c0b8b66cec63aaae" args="(const fs::path &amp;p1, const fs::path &amp;p2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool comparePaths </td>
          <td>(</td>
          <td class="paramtype">const fs::path &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const fs::path &amp;&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="ExampleSourceViewer_8C_source.html#l00066">66</a> of file <a class="el" href="ExampleSourceViewer_8C_source.html">ExampleSourceViewer.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <span class="keywordflow">return</span> <a class="code" href="ExampleSourceViewer_8C.html#a90d62aee81b34c117b8f494a54bee4d4">filename</a>(p1) &gt; <a class="code" href="ExampleSourceViewer_8C.html#a90d62aee81b34c117b8f494a54bee4d4">filename</a>(p2);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a90d62aee81b34c117b8f494a54bee4d4"></a><!-- doxytag: member="ExampleSourceViewer.C::filename" ref="a90d62aee81b34c117b8f494a54bee4d4" args="(const fs::path &amp;p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static std::string filename </td>
          <td>(</td>
          <td class="paramtype">const fs::path &amp;&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="ExampleSourceViewer_8C_source.html#l00036">36</a> of file <a class="el" href="ExampleSourceViewer_8C_source.html">ExampleSourceViewer.C</a>.</p>
<div class="fragment"><pre class="fragment">{
<span class="preprocessor">#if BOOST_FILESYSTEM_VERSION &lt; 3</span>
<span class="preprocessor"></span>  <span class="keywordflow">return</span> p.empty() ? std::string() : *--p.end();
<span class="preprocessor">#else</span>
<span class="preprocessor"></span>  <span class="keywordflow">return</span> p.empty() ? std::string() : (*--p.end()).string();
<span class="preprocessor">#endif</span>
<span class="preprocessor"></span>}
</pre></div>
</div>
</div>
<a class="anchor" id="a0c61a4a8c171f6b23a9fc3872c2e9e5d"></a><!-- doxytag: member="ExampleSourceViewer.C::getCompanion" ref="a0c61a4a8c171f6b23a9fc3872c2e9e5d" args="(const fs::path &amp;path)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static fs::path getCompanion </td>
          <td>(</td>
          <td class="paramtype">const fs::path &amp;&#160;</td>
          <td class="paramname"><em>path</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="ExampleSourceViewer_8C_source.html#l00182">182</a> of file <a class="el" href="ExampleSourceViewer_8C_source.html">ExampleSourceViewer.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  std::string ext = fs::extension(path);

  <span class="keywordflow">if</span> (ext == <span class="stringliteral">&quot;.h&quot;</span>)
    <span class="keywordflow">return</span> <a class="code" href="ExampleSourceViewer_8C.html#ae19c9a4a8bd0a5e02a00d6e17707a342">parent_path</a>(path) / (<a class="code" href="ExampleSourceViewer_8C.html#a2fb90126657b786f14062b06f995583c">stem</a>(path) + <span class="stringliteral">&quot;.C&quot;</span>);
  <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ext == <span class="stringliteral">&quot;.C&quot;</span> || ext == <span class="stringliteral">&quot;.cpp&quot;</span>)
    <span class="keywordflow">return</span> <a class="code" href="ExampleSourceViewer_8C.html#ae19c9a4a8bd0a5e02a00d6e17707a342">parent_path</a>(path) / (<a class="code" href="ExampleSourceViewer_8C.html#a2fb90126657b786f14062b06f995583c">stem</a>(path) + <span class="stringliteral">&quot;.h&quot;</span>);
  <span class="keywordflow">else</span>
    <span class="keywordflow">return</span> fs::path();
}
</pre></div>
</div>
</div>
<a class="anchor" id="ae19c9a4a8bd0a5e02a00d6e17707a342"></a><!-- doxytag: member="ExampleSourceViewer.C::parent_path" ref="ae19c9a4a8bd0a5e02a00d6e17707a342" args="(const fs::path &amp;p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">fs::path parent_path </td>
          <td>(</td>
          <td class="paramtype">const fs::path &amp;&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="ExampleSourceViewer_8C_source.html#l00058">58</a> of file <a class="el" href="ExampleSourceViewer_8C_source.html">ExampleSourceViewer.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  std::string fn = <a class="code" href="ExampleSourceViewer_8C.html#a90d62aee81b34c117b8f494a54bee4d4">filename</a>(p);
  std::string path = p.string();

  <span class="keywordflow">return</span> path.substr(0, path.length() - fn.length() - 1);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a2fb90126657b786f14062b06f995583c"></a><!-- doxytag: member="ExampleSourceViewer.C::stem" ref="a2fb90126657b786f14062b06f995583c" args="(const fs::path &amp;p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static std::string stem </td>
          <td>(</td>
          <td class="paramtype">const fs::path &amp;&#160;</td>
          <td class="paramname"><em>p</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="ExampleSourceViewer_8C_source.html#l00046">46</a> of file <a class="el" href="ExampleSourceViewer_8C_source.html">ExampleSourceViewer.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  std::string fn = <a class="code" href="ExampleSourceViewer_8C.html#a90d62aee81b34c117b8f494a54bee4d4">filename</a>(p);
  std::size_t pos = fn.find(<span class="charliteral">&#39;.&#39;</span>);
  <span class="keywordflow">if</span> (pos == std::string::npos)
    <span class="keywordflow">return</span> fn;
  <span class="keywordflow">else</span>
    <span class="keywordflow">return</span> fn.substr(0, pos);
}
</pre></div>
</div>
</div>
</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&nbsp;<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>