A C++ DAL / ORM code generation framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

682 lines
42 KiB

<!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>WORM: WSql::WSqlField Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}
function addClass(ele,cls) {
if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}
function removeClass(ele,cls) {
if (hasClass(ele,cls)) {
var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
ele.className=ele.className.replace(reg,' ');
}
}
function toggleVisibility(linkObj) {
var base = linkObj.getAttribute('id');
var summary = document.getElementById(base + '-summary');
var content = document.getElementById(base + '-content');
var trigger = document.getElementById(base + '-trigger');
if ( hasClass(linkObj,'closed') ) {
summary.style.display = 'none';
content.style.display = 'block';
trigger.src = 'open.png';
removeClass(linkObj,'closed');
addClass(linkObj,'opened');
} else if ( hasClass(linkObj,'opened') ) {
summary.style.display = 'block';
content.style.display = 'none';
trigger.src = 'closed.png';
removeClass(linkObj,'opened');
addClass(linkObj,'closed');
}
return false;
}
</script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="worm_sm.png"></td>
<td style="padding-left: 0.5em;">
<div id="projectname">WORM&#160;<span id="projectnumber">0.2</span></div>
<div id="projectbrief">A C++ DAL/ORM code generation framework</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</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>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespace_w_sql.html">WSql</a> </li>
<li class="navelem"><a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> </li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<h1>WSql::WSqlField Class Reference</h1> </div>
</div>
<div class="contents">
<!-- doxytag: class="WSql::WSqlField" -->
<p>The <a class="el" href="class_w_sql_1_1_w_sql_field.html" title="The WSqlField class represents a field in a record.">WSqlField</a> class represents a field in a record.
<a href="#_details">More...</a></p>
<p><code>#include &lt;<a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>&gt;</code></p>
<p><a href="class_w_sql_1_1_w_sql_field-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a0dd42e00ccb9869989b1bda585c85d3f">WSqlField</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a4b969acf7e18fe8aea98f6474f9dd549">WSqlField</a> (const std::string &amp;fieldName, const std::string &amp;columnName=std::string())</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a6d13d952f74c177f24d96a23c7889688">operator=</a> (const <a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a9aeafd8ad1f6b26ae9f19d559c5a9788">operator==</a> (const <a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp;other) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#acb49c435cad44cc3e0b6c95d44c72fc7">operator!=</a> (const <a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp;other) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a38ff89e6025ddf2807e59f852710be50">~WSqlField</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a811c3e5bc9c0dad605d1bbfc1856e495">setData</a> (std::string s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions for setting the value of the data. <a href="#a811c3e5bc9c0dad605d1bbfc1856e495"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a3434bacc1437c15fc4148e55c6bec47c">setData</a> (short sh)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#aecea0803b54fcc83056b19a5a5af40e5">setData</a> (int i)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a7911192da632f9a8577395d9d11ef4d3">setData</a> (long l)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a4108c7b4e2f9ec53b6cf46ab1ad00f99">setData</a> (float f)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a5b41e4e3cfbd6f83f85da93a29535921">setData</a> (double d)</td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a3f48248a0281a2beb96cecde18185bd1">data</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="class_w_sql_1_1_w_sql_datum.html">WSqlDatum</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#aff27cae280caaa89b30a1666fbc5d770">rawDatum</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a2a6d7066f692882849c81b10aa9eba08">clear</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#ac0966bdbf13441434dd307baa2673194">setName</a> (const std::string &amp;fname)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#ac0d7a9fa06ff09cacdac9cd1a8c11109">setColumnName</a> (const std::string &amp;cname)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a37da6850bd578aafbf5b4e4cb7f059af">setIsDirty</a> (bool b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a75ffb62cf646cae4e90b0226052c1d5a">setPrecision</a> (int i)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a82c823aaaca531dd3ba39c4308d2ab1e">isDirty</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a953649f01aad00a111f5879295aa07b8">name</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name of the field in the record. <a href="#a953649f01aad00a111f5879295aa07b8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a9d7961be812bf9aedd031abbd0126a62">columnName</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name of the column as defined in the database.. <a href="#a9d7961be812bf9aedd031abbd0126a62"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_w_sql_1_1_w_sql_field.html#a445c702691d6b8f3be5d146b914986e3">precision</a> () const </td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="class_w_sql_1_1_w_sql_field.html" title="The WSqlField class represents a field in a record.">WSqlField</a> class represents a field in a record. </p>
<p><a class="el" href="class_w_sql_1_1_w_sql_field.html" title="The WSqlField class represents a field in a record.">WSqlField</a> represents the data contained a single field of a record in a result set returned from a query. Each field contains the value stored as a <a class="el" href="class_w_sql_1_1_w_sql_datum.html" title="The WSqlDatum class represents an abstraction of a data element retrieved from a database.">WSqlDatum</a> and the name of the field associated is a string. Note that the name of the field corresponds to either the column name as defined in the database or the alias defined in the query. The column name defined in the database is available using <a class="el" href="class_w_sql_1_1_w_sql_field.html#a9d7961be812bf9aedd031abbd0126a62" title="Returns the name of the column as defined in the database..">columnName()</a>. Drivers should initialize both of these when constructing a field for a result set; users should initialize at least name and preferable columnName if using the field for an insert or update.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>Inserts and updates using <a class="el" href="class_w_sql_1_1_w_sql_field.html" title="The WSqlField class represents a field in a record.">WSqlField</a> are not yet supported (10/2011) .</dd></dl>
<p>WSqlFields are used to populate a <a class="el" href="class_w_sql_1_1_w_sql_record.html" title="The WSqlRecord class represents a database record.">WSqlRecord</a> in a <a class="el" href="class_w_sql_1_1_w_sql_result.html" title="The WSqlResult class provides a representation of the result set from a query.">WSqlResult</a>. See below for an example.</p>
<p>The data value is converted on demand to supported types (currently native C++ types and std::string) and can be retrieved using the function <a class="el" href="class_w_sql_1_1_w_sql_field.html#a3f48248a0281a2beb96cecde18185bd1">data()</a>. Alternately, the full <a class="el" href="class_w_sql_1_1_w_sql_datum.html" title="The WSqlDatum class represents an abstraction of a data element retrieved from a database.">WSqlDatum</a> can be retrieved using rawData(). For example:</p>
<div class="fragment"><pre class="fragment"> <span class="comment">//assume a record is available ..</span>
<a class="code" href="class_w_sql_1_1_w_sql_field.html#a0dd42e00ccb9869989b1bda585c85d3f">WSqlField</a> fldName = record.<a class="code" href="class_w_sql_1_1_w_sql_record.html#a6b4afb8edabdf5643a56e293f87db609">field</a>(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;user_name&quot;</span>));
<span class="keywordtype">string</span> <a class="code" href="class_w_sql_1_1_w_sql_field.html#a953649f01aad00a111f5879295aa07b8" title="Returns the name of the field in the record.">name</a> = fldName.data&lt;<span class="keywordtype">string</span>&gt;();
<span class="comment">//or</span>
<span class="keywordtype">int</span> idnumber = record.<a class="code" href="class_w_sql_1_1_w_sql_record.html#a6b4afb8edabdf5643a56e293f87db609">field</a>(<span class="keywordtype">string</span>(<span class="stringliteral">&quot;user_id&quot;</span>)).data&lt;<span class="keywordtype">int</span>&gt;();
<span class="comment">//or</span>
WSqlDatum datum = field.rawData();
<span class="comment">//do something with the datum ..</span>
</pre></div><p>Other methods provide more infomation about the field. <a class="el" href="class_w_sql_1_1_w_sql_field.html#a9d7961be812bf9aedd031abbd0126a62" title="Returns the name of the column as defined in the database..">columnName()</a> returns the name of the column as defined in the database table (or view), <a class="el" href="class_w_sql_1_1_w_sql_field.html#a82c823aaaca531dd3ba39c4308d2ab1e">isDirty()</a> returns true if the field has been modified - note that this must be set by the user.</p>
<p>The value of the data can be set using <a class="el" href="class_w_sql_1_1_w_sql_field.html#a811c3e5bc9c0dad605d1bbfc1856e495" title="Functions for setting the value of the data.">setData()</a> which provides several overloads to all setting the data with the supported types. Note that the types are coverted to string and stored in the <a class="el" href="class_w_sql_1_1_w_sql_datum.html" title="The WSqlDatum class represents an abstraction of a data element retrieved from a database.">WSqlDatum</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a3f48248a0281a2beb96cecde18185bd1">data()</a> <a class="el" href="class_w_sql_1_1_w_sql_field.html#a953649f01aad00a111f5879295aa07b8" title="Returns the name of the field in the record.">name()</a> <a class="el" href="class_w_sql_1_1_w_sql_field.html#a9d7961be812bf9aedd031abbd0126a62" title="Returns the name of the column as defined in the database..">columnName()</a> <a class="el" href="class_w_sql_1_1_w_sql_field.html#a811c3e5bc9c0dad605d1bbfc1856e495" title="Functions for setting the value of the data.">setData()</a> </dd>
<dd>
<a class="el" href="class_w_sql_1_1_w_sql_record.html" title="The WSqlRecord class represents a database record.">WSqlRecord</a> <a class="el" href="class_w_sql_1_1_w_sql_datum.html" title="The WSqlDatum class represents an abstraction of a data element retrieved from a database.">WSqlDatum</a> <a class="el" href="namespace_w_sql_1_1_w_sql_data_type.html" title="WSqlDataType namespace - Utilities and definitions of supported data types.">WSqlDataType</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00029">29</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a0dd42e00ccb9869989b1bda585c85d3f"></a><!-- doxytag: member="WSql::WSqlField::WSqlField" ref="a0dd42e00ccb9869989b1bda585c85d3f" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WSql::WSqlField::WSqlField </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs an empty <a class="el" href="class_w_sql_1_1_w_sql_field.html" title="The WSqlField class represents a field in a record.">WSqlField</a></p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#ac0966bdbf13441434dd307baa2673194">setName()</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8cpp_source.html#l00079">79</a> of file <a class="el" href="wsqlfield_8cpp_source.html">wsqlfield.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a4b969acf7e18fe8aea98f6474f9dd549"></a><!-- doxytag: member="WSql::WSqlField::WSqlField" ref="a4b969acf7e18fe8aea98f6474f9dd549" args="(const std::string &amp;fieldName, const std::string &amp;columnName=std::string())" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WSql::WSqlField::WSqlField </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>fieldName</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>columnName</em> = <code>std::string()</code>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs an empty <a class="el" href="class_w_sql_1_1_w_sql_field.html" title="The WSqlField class represents a field in a record.">WSqlField</a> with the name set to <em>fieldName</em> and the column name set to <em>columnName</em>. If <em>columnName</em> is not supplied it is assumed to be the same as fieldName and set accordingly.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#ac0966bdbf13441434dd307baa2673194">setName()</a> setDataType() </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8cpp_source.html#l00092">92</a> of file <a class="el" href="wsqlfield_8cpp_source.html">wsqlfield.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a38ff89e6025ddf2807e59f852710be50"></a><!-- doxytag: member="WSql::WSqlField::~WSqlField" ref="a38ff89e6025ddf2807e59f852710be50" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WSql::WSqlField::~WSqlField </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destroys the object and frees any allocated resources. </p>
<p>Definition at line <a class="el" href="wsqlfield_8cpp_source.html#l00141">141</a> of file <a class="el" href="wsqlfield_8cpp_source.html">wsqlfield.cpp</a>.</p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a2a6d7066f692882849c81b10aa9eba08"></a><!-- doxytag: member="WSql::WSqlField::clear" ref="a2a6d7066f692882849c81b10aa9eba08" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::clear </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Clears the value of the field and resets the precision to the default If the field is read-only, nothing happens.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a811c3e5bc9c0dad605d1bbfc1856e495" title="Functions for setting the value of the data.">setData()</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8cpp_source.html#l00177">177</a> of file <a class="el" href="wsqlfield_8cpp_source.html">wsqlfield.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9d7961be812bf9aedd031abbd0126a62"></a><!-- doxytag: member="WSql::WSqlField::columnName" ref="a9d7961be812bf9aedd031abbd0126a62" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string WSql::WSqlField::columnName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the name of the column as defined in the database.. </p>
<p>Note that this is the name as it is in the actual database and not necessarily the name of the field returned which may be an alias defined in the query. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a953649f01aad00a111f5879295aa07b8" title="Returns the name of the field in the record.">name()</a> <a class="el" href="class_w_sql_1_1_w_sql_field.html#ac0d7a9fa06ff09cacdac9cd1a8c11109">setColumnName()</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00065">65</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3f48248a0281a2beb96cecde18185bd1"></a><!-- doxytag: member="WSql::WSqlField::data" ref="a3f48248a0281a2beb96cecde18185bd1" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="memname">
<tr>
<td class="memname">template&lt; typename T &gt; T WSql::WSqlField::data </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the field's type as defined in the database. </p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000034">Todo:</a></b></dt><dd>decide if <a class="el" href="class_w_sql_1_1_w_sql_field.html" title="The WSqlField class represents a field in a record.">WSqlField</a> needs/supports this (and other metadata) - also readOnly and so on .. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd>setDataType()</dd></dl>
<p>Returns the value of the data in various formats. Valid return values are native C++ types (eg. int, long, float, double, etc.) or std::string. Example: </p>
<div class="fragment"><pre class="fragment"> <a class="code" href="class_w_sql_1_1_w_sql_field.html#a0dd42e00ccb9869989b1bda585c85d3f">WSqlField</a> field;
<span class="comment">// ... set field with some value</span>
<span class="keywordtype">double</span> d = 1223.34;
field.setData(d);
<span class="keywordtype">double</span> dd = field.data&lt;<span class="keywordtype">double</span>&gt;(); <span class="comment">//dd contains 1223.34</span>
<span class="keywordtype">int</span> i = field.data&lt;<span class="keywordtype">int</span>&gt;(); <span class="comment">//i contains 1223</span>
<span class="keywordtype">string</span> s = field.data&lt;<span class="keywordtype">string</span>&gt;(); <span class="comment">//s contains &quot;1223.34&quot;</span>
</pre></div><dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a811c3e5bc9c0dad605d1bbfc1856e495" title="Functions for setting the value of the data.">setData()</a> <a class="el" href="class_w_sql_1_1_w_sql_datum.html" title="The WSqlDatum class represents an abstraction of a data element retrieved from a database.">WSqlDatum</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00050">50</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a82c823aaaca531dd3ba39c4308d2ab1e"></a><!-- doxytag: member="WSql::WSqlField::isDirty" ref="a82c823aaaca531dd3ba39c4308d2ab1e" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const bool WSql::WSqlField::isDirty </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00063">63</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a953649f01aad00a111f5879295aa07b8"></a><!-- doxytag: member="WSql::WSqlField::name" ref="a953649f01aad00a111f5879295aa07b8" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string WSql::WSqlField::name </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns the name of the field in the record. </p>
<p>Note that this may be different from the actual name of the column defined in the database if an alias was defined in the query. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a9d7961be812bf9aedd031abbd0126a62" title="Returns the name of the column as defined in the database..">columnName()</a> <a class="el" href="class_w_sql_1_1_w_sql_field.html#ac0d7a9fa06ff09cacdac9cd1a8c11109">setColumnName()</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00064">64</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="acb49c435cad44cc3e0b6c95d44c72fc7"></a><!-- doxytag: member="WSql::WSqlField::operator!=" ref="acb49c435cad44cc3e0b6c95d44c72fc7" args="(const WSqlField &amp;other) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool WSql::WSqlField::operator!= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the field is unequal to <em>other</em>; otherwise returns false. </p>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00040">40</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a6d13d952f74c177f24d96a23c7889688"></a><!-- doxytag: member="WSql::WSqlField::operator=" ref="a6d13d952f74c177f24d96a23c7889688" args="(const WSqlField &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp; WSql::WSqlField::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the field equal to <em>other</em>. </p>
<p>Definition at line <a class="el" href="wsqlfield_8cpp_source.html#l00106">106</a> of file <a class="el" href="wsqlfield_8cpp_source.html">wsqlfield.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a9aeafd8ad1f6b26ae9f19d559c5a9788"></a><!-- doxytag: member="WSql::WSqlField::operator==" ref="a9aeafd8ad1f6b26ae9f19d559c5a9788" args="(const WSqlField &amp;other) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool WSql::WSqlField::operator== </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_w_sql_1_1_w_sql_field.html">WSqlField</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the field is equal to <em>other</em>; otherwise returns false. </p>
<p>Definition at line <a class="el" href="wsqlfield_8cpp_source.html#l00126">126</a> of file <a class="el" href="wsqlfield_8cpp_source.html">wsqlfield.cpp</a>.</p>
</div>
</div>
<a class="anchor" id="a445c702691d6b8f3be5d146b914986e3"></a><!-- doxytag: member="WSql::WSqlField::precision" ref="a445c702691d6b8f3be5d146b914986e3" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const int WSql::WSqlField::precision </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00066">66</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="aff27cae280caaa89b30a1666fbc5d770"></a><!-- doxytag: member="WSql::WSqlField::rawDatum" ref="aff27cae280caaa89b30a1666fbc5d770" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="class_w_sql_1_1_w_sql_datum.html">WSqlDatum</a>&amp; WSql::WSqlField::rawDatum </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00055">55</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac0d7a9fa06ff09cacdac9cd1a8c11109"></a><!-- doxytag: member="WSql::WSqlField::setColumnName" ref="ac0d7a9fa06ff09cacdac9cd1a8c11109" args="(const std::string &amp;cname)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setColumnName </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the column name of the field to <em>name</em>. Note that this does not (yet) effect the actual column name in the database.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a9d7961be812bf9aedd031abbd0126a62" title="Returns the name of the column as defined in the database..">columnName()</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00059">59</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="aecea0803b54fcc83056b19a5a5af40e5"></a><!-- doxytag: member="WSql::WSqlField::setData" ref="aecea0803b54fcc83056b19a5a5af40e5" args="(int i)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setData </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>i</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00045">45</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a5b41e4e3cfbd6f83f85da93a29535921"></a><!-- doxytag: member="WSql::WSqlField::setData" ref="a5b41e4e3cfbd6f83f85da93a29535921" args="(double d)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setData </td>
<td>(</td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>d</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00048">48</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a4108c7b4e2f9ec53b6cf46ab1ad00f99"></a><!-- doxytag: member="WSql::WSqlField::setData" ref="a4108c7b4e2f9ec53b6cf46ab1ad00f99" args="(float f)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setData </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>f</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00047">47</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7911192da632f9a8577395d9d11ef4d3"></a><!-- doxytag: member="WSql::WSqlField::setData" ref="a7911192da632f9a8577395d9d11ef4d3" args="(long l)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setData </td>
<td>(</td>
<td class="paramtype">long&#160;</td>
<td class="paramname"><em>l</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00046">46</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a811c3e5bc9c0dad605d1bbfc1856e495"></a><!-- doxytag: member="WSql::WSqlField::setData" ref="a811c3e5bc9c0dad605d1bbfc1856e495" args="(std::string s)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setData </td>
<td>(</td>
<td class="paramtype">std::string&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Functions for setting the value of the data. </p>
<p>These functions set the value of the field to <em>value</em>. If the field is read-only (isReadOnly() returns true), nothing happens. The data type of <em>value</em> must be either a native C++ type (eg. int, long, double, etc ) or a std::string. The value is converted (if numeric) and stored as a string. The default floating point precision for setting the value is 2 - greater precision can be had by using <a class="el" href="class_w_sql_1_1_w_sql_field.html#a75ffb62cf646cae4e90b0226052c1d5a">setPrecision()</a> before setting the value.</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000033">Todo:</a></b></dt><dd>implement that last sentence . set precision is tbd. To set the value to NULL, use <a class="el" href="class_w_sql_1_1_w_sql_field.html#a2a6d7066f692882849c81b10aa9eba08">clear()</a>.</dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a3f48248a0281a2beb96cecde18185bd1">data()</a> <a class="el" href="class_w_sql_1_1_w_sql_field.html#a75ffb62cf646cae4e90b0226052c1d5a">setPrecision()</a> isReadOnly() </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00043">43</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a3434bacc1437c15fc4148e55c6bec47c"></a><!-- doxytag: member="WSql::WSqlField::setData" ref="a3434bacc1437c15fc4148e55c6bec47c" args="(short sh)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setData </td>
<td>(</td>
<td class="paramtype">short&#160;</td>
<td class="paramname"><em>sh</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00044">44</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a37da6850bd578aafbf5b4e4cb7f059af"></a><!-- doxytag: member="WSql::WSqlField::setIsDirty" ref="a37da6850bd578aafbf5b4e4cb7f059af" args="(bool b)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setIsDirty </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>b</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00060">60</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="ac0966bdbf13441434dd307baa2673194"></a><!-- doxytag: member="WSql::WSqlField::setName" ref="ac0966bdbf13441434dd307baa2673194" args="(const std::string &amp;fname)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setName </td>
<td>(</td>
<td class="paramtype">const std::string &amp;&#160;</td>
<td class="paramname"><em>name</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the name of the field to <em>name</em>. This will correspond to the column name or be the alias defined in the query.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_w_sql_1_1_w_sql_field.html#a953649f01aad00a111f5879295aa07b8" title="Returns the name of the field in the record.">name()</a> </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00058">58</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<a class="anchor" id="a75ffb62cf646cae4e90b0226052c1d5a"></a><!-- doxytag: member="WSql::WSqlField::setPrecision" ref="a75ffb62cf646cae4e90b0226052c1d5a" args="(int i)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void WSql::WSqlField::setPrecision </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>precision</em></td><td>)</td>
<td><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the field's <em>precision</em>. This only affects numeric fields.</p>
<dl class="see"><dt><b>See also:</b></dt><dd>getPrecision() </dd></dl>
<p>Definition at line <a class="el" href="wsqlfield_8h_source.html#l00061">61</a> of file <a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/sql/<a class="el" href="wsqlfield_8h_source.html">wsqlfield.h</a></li>
<li>src/sql/<a class="el" href="wsqlfield_8cpp_source.html">wsqlfield.cpp</a></li>
</ul>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Nov 18 2011 21:01:46 for WORM by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>