<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>PolyBoRi: CStringLiteral.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</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 class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>CStringLiteral.h</h1><a href="CStringLiteral_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- c++ -*-</span> <a name="l00002"></a>00002 <span class="comment">//*****************************************************************************</span> <a name="l00033"></a>00033 <span class="comment"></span><span class="comment">//*****************************************************************************</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="comment">// include basic definitions</span> <a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="pbori__defs_8h.html">pbori_defs.h</a>"</span> <a name="l00037"></a>00037 <a name="l00038"></a>00038 <span class="comment">// get standard string capability</span> <a name="l00039"></a>00039 <span class="preprocessor">#include <string></span> <a name="l00040"></a>00040 <a name="l00041"></a>00041 <span class="comment">// get literal codes (enumeration)</span> <a name="l00042"></a>00042 <span class="preprocessor">#include "<a class="code" href="CLiteralCodes_8h.html">CLiteralCodes.h</a>"</span> <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="preprocessor">#ifndef CStringLiteral_h_</span> <a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define CStringLiteral_h_</span> <a name="l00046"></a>00046 <span class="preprocessor"></span> <a name="l00047"></a>00047 <a class="code" href="pbori__defs_8h.html#6ae360a591580558f31b6157ee792a10" title="Start project&#39;s namespace.">BEGIN_NAMESPACE_PBORI</a> <a name="l00048"></a>00048 <a name="l00054"></a>00054 <span class="keyword">template</span> <<span class="keywordtype">unsigned</span> LitCode = CLiteralCodes::first_code> <a name="l00055"></a><a class="code" href="classpolybori_1_1CStringLiteral.html">00055</a> <span class="keyword">class </span><a class="code" href="classpolybori_1_1CStringLiteral.html" title="This template class defines string literals corresponding to the codes enumerated...">CStringLiteral</a> { <a name="l00056"></a>00056 <span class="keyword">public</span>: <a name="l00057"></a>00057 <a name="l00059"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#44f29b3f25a5838fc685bea3ea7bae8f">00059</a> <span class="keyword">typedef</span> std::string literal_type; <a name="l00060"></a>00060 <a name="l00062"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#9506a6d1da546056fc7e9d1c1a87da51">00062</a> <a class="code" href="classpolybori_1_1CStringLiteral.html#9506a6d1da546056fc7e9d1c1a87da51" title="Default constructor.">CStringLiteral</a>() {}; <a name="l00063"></a>00063 <a name="l00065"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#e52f60e9a1264e34aeabcb8ceae834e1">00065</a> <a class="code" href="classpolybori_1_1CStringLiteral.html#e52f60e9a1264e34aeabcb8ceae834e1" title="Destructor.">~CStringLiteral</a>() {}; <a name="l00066"></a>00066 <a name="l00068"></a>00068 literal_type operator()() <span class="keyword">const</span>; <a name="l00069"></a>00069 }; <a name="l00070"></a>00070 <a name="l00071"></a>00071 <a name="l00072"></a><a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">00072</a> <span class="preprocessor">#define GENERATE_CSTRINGLITERAL(CODE, STRING) \</span> <a name="l00073"></a>00073 <span class="preprocessor">template <> inline CStringLiteral<>::literal_type \</span> <a name="l00074"></a>00074 <span class="preprocessor">CStringLiteral<CLiteralCodes::CODE>::operator()() const{ return STRING; }</span> <a name="l00075"></a>00075 <span class="preprocessor"></span> <a name="l00076"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#c1ac9f385ad0417a72251153947dd395">00076</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(empty, <span class="stringliteral">""</span>) <a name="l00077"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#ca1bb7c23e023fb888afa30730613b70">00077</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(space, " ") <a name="l00078"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#9339cb335f1a0c1b74165f857901427e">00078</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(plus, "+") <a name="l00079"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#4cff6917acf5eb66eadb7d1bfa479e37">00079</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(term_separator, " + ") <a name="l00080"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#3390174ae4c4fef6a36ccf6b7b69b190">00080</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(times, "*") <a name="l00081"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#523677f45c3c40f7a78fab8f384b993d">00081</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(comma, ",") <a name="l00082"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#0028b1f6dd7093d599ee16e2d71e0947">00082</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(list_separator, ", ") <a name="l00083"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#c19d10d2988175e89c3482349225b623">00083</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(default_variable_name, "x") <a name="l00084"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#8ae2804ed7735955cc90c4be1363297e">00084</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(variable_head, "(") <a name="l00085"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#b132852ae01273936792a5f2090542cf">00085</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(variable_tail, ")") <a name="l00086"></a><a class="code" href="classpolybori_1_1CStringLiteral.html#c767431733088225fba0f7903ea77848">00086</a> <a class="code" href="CStringLiteral_8h.html#5a0a74d72493e7043e69ae9e54b7b606">GENERATE_CSTRINGLITERAL</a>(between_list_separator, "}, {<span class="stringliteral">")</span> <a name="l00087"></a>00087 <span class="stringliteral"></span> <a name="l00088"></a>00088 <span class="stringliteral">#undef GENERATE_CSTRINGLITERAL</span> <a name="l00089"></a>00089 <span class="stringliteral"></span> <a name="l00090"></a>00090 <span class="stringliteral">END_NAMESPACE_PBORI</span> <a name="l00091"></a>00091 <span class="stringliteral"></span> <a name="l00092"></a>00092 <span class="stringliteral">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Sep 9 14:30:55 2009 for PolyBoRi by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>