1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt: Wt::Dbo::sql_value_traits< V, Enable > Class Template Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<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="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>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="namespaceWt_1_1Dbo.html">Dbo</a>::<a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html">sql_value_traits</a>
</div>
</div>
<div class="contents">
<h1>Wt::Dbo::sql_value_traits< V, Enable > Class Template Reference<br>
<small>
[<a class="el" href="group__dbo.html">Database Objects library (Dbo)</a>]</small>
</h1><!-- doxytag: class="Wt::Dbo::sql_value_traits" -->Traits class for value types.
<a href="#_details">More...</a>
<p>
<code>#include <Wt/Dbo/SqlTraits></code>
<p>
<p>
<a href="classWt_1_1Dbo_1_1sql__value__traits-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html#938ffa7506a84bf46fa6e9a4d3c69253">type</a> (<a class="el" href="classWt_1_1Dbo_1_1SqlConnection.html">SqlConnection</a> *connection, int size)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the SQL type name. <a href="#938ffa7506a84bf46fa6e9a4d3c69253"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html#eed1a933f3d83555b5d39ac76b929170">bind</a> (const V &v, <a class="el" href="classWt_1_1Dbo_1_1SqlStatement.html">SqlStatement</a> *statement, int index, int size)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Binds a value to a statement parameter. <a href="#eed1a933f3d83555b5d39ac76b929170"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html#dc493756b9faf369c95efd617d2b2624">read</a> (V &v, <a class="el" href="classWt_1_1Dbo_1_1SqlStatement.html">SqlStatement</a> *statement, int column, int size)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Reads a result from an executed query. <a href="#dc493756b9faf369c95efd617d2b2624"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<typename V, class Enable = void><br>
class Wt::Dbo::sql_value_traits< V, Enable ></h3>
Traits class for value types.
<p>
This traits class may be specialized for a custom type <code>V</code>, to add dbo support for custom types. A value type has a one-to-one mapping to a single database column.<p>
The library has built-in support for:<ul>
<li>std::string</li><li>char const * (read-only: only as a bound parameter for a query)</li><li>short, int, long, long long</li><li>float, double</li><li>enum types</li><li>std::vector<unsigned char> (binary data)</li><li>boost::optional<T>: to make the type optionally <code>null</code></li></ul>
<p>
In <Wt/Dbo/WtSqlTraits>, traits classes are also provided for:<ul>
<li><a class="el" href="classWt_1_1WDate.html" title="A gregorian calendar date.">WDate</a></li><li><a class="el" href="classWt_1_1WDateTime.html" title="A calendar date and clock time.">WDateTime</a></li><li><a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a></li></ul>
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="structWt_1_1Dbo_1_1sql__result__traits.html" title="Traits class for result types.">sql_result_traits</a> </dd></dl>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="938ffa7506a84bf46fa6e9a4d3c69253"></a><!-- doxytag: member="Wt::Dbo::sql_value_traits::type" ref="938ffa7506a84bf46fa6e9a4d3c69253" args="(SqlConnection *connection, int size)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename V, class Enable = void> </div>
<table class="memname">
<tr>
<td class="memname">static const char* <a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html">Wt::Dbo::sql_value_traits</a>< V, Enable >::type </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classWt_1_1Dbo_1_1SqlConnection.html">SqlConnection</a> * </td>
<td class="paramname"> <em>connection</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>size</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the SQL type name.
<p>
The <code>size</code> (for strings) is a hint and may be ignored by a back-end.
</div>
</div><p>
<a class="anchor" name="eed1a933f3d83555b5d39ac76b929170"></a><!-- doxytag: member="Wt::Dbo::sql_value_traits::bind" ref="eed1a933f3d83555b5d39ac76b929170" args="(const V &v, SqlStatement *statement, int index, int size)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename V, class Enable = void> </div>
<table class="memname">
<tr>
<td class="memname">static void <a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html">Wt::Dbo::sql_value_traits</a>< V, Enable >::bind </td>
<td>(</td>
<td class="paramtype">const V & </td>
<td class="paramname"> <em>v</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classWt_1_1Dbo_1_1SqlStatement.html">SqlStatement</a> * </td>
<td class="paramname"> <em>statement</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>index</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>size</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Binds a value to a statement parameter.
<p>
The value <code>v</code> must be bound to parameter with index <code>index</code> in the <code>statement</code>.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1SqlStatement.html#d8b53ca87bdef11ceceb96ab05c260b9" title="Binds a value to a column.">SqlStatement::bind()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="dc493756b9faf369c95efd617d2b2624"></a><!-- doxytag: member="Wt::Dbo::sql_value_traits::read" ref="dc493756b9faf369c95efd617d2b2624" args="(V &v, SqlStatement *statement, int column, int size)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<typename V, class Enable = void> </div>
<table class="memname">
<tr>
<td class="memname">static void <a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html">Wt::Dbo::sql_value_traits</a>< V, Enable >::read </td>
<td>(</td>
<td class="paramtype">V & </td>
<td class="paramname"> <em>v</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classWt_1_1Dbo_1_1SqlStatement.html">SqlStatement</a> * </td>
<td class="paramname"> <em>statement</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>column</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>size</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Reads a result from an executed query.
<p>
The value <code>v</code> must be read from result column <code>column</code> in the <code>statement</code>.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1Dbo_1_1SqlStatement.html#fca829eb43f0977b2af6ea7e0b66aad1" title="Fetches a result value.">SqlStatement::getResult()</a> </dd></dl>
</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:08 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>
|