File: null_8h.html

package info (click to toggle)
mysql%2B%2B 3.2.5-2.1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 18,360 kB
  • sloc: cpp: 35,788; sh: 3,693; perl: 789; makefile: 730
file content (150 lines) | stat: -rwxr-xr-x 10,992 bytes parent folder | download | duplicates (3)
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
<!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>
  <title>MySQL++ Reference Manual</title>
  <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  <meta name="generator" content="Doxygen 1.8.15"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <title>MySQL++: null.h File Reference</title>
  <link href="tabs.css" rel="stylesheet" type="text/css"/>
  <link href="doxygen.css" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript" src="dynsections.js"></script>
  <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
  <link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
  <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
    <div id="titlearea">
    <table cellspacing="0" cellpadding="0">
     <tbody>
     <tr style="height: 56px;">
      <td id="projectalign" style="padding-left: 0.5em;">
       <div id="projectname">MySQL++
       &#160;<span id="projectnumber">3.2.5</span>
       </div>
      </td>
     </tr>
     </tbody>
    </table>
    </div>
    <!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">null.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Declares classes that implement SQL "null" semantics within C++'s type system.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="exceptions_8h_source.html">exceptions.h</a>&quot;</code><br />
<code>#include &lt;iostream&gt;</code><br />
<code>#include &lt;string&gt;</code><br />
</div>
<p><a href="null_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1null__type.html">mysqlpp::null_type</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type of the global mysqlpp::null object.  <a href="classmysqlpp_1_1null__type.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmysqlpp_1_1NullIsNull.html">mysqlpp::NullIsNull</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class for objects that define SQL null in terms of MySQL++'s <a class="el" href="classmysqlpp_1_1null__type.html" title="The type of the global mysqlpp::null object.">null_type</a>.  <a href="structmysqlpp_1_1NullIsNull.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmysqlpp_1_1NullIsZero.html">mysqlpp::NullIsZero</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class for objects that define SQL null as 0.  <a href="structmysqlpp_1_1NullIsZero.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structmysqlpp_1_1NullIsBlank.html">mysqlpp::NullIsBlank</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class for objects that define SQL null as a blank C string.  <a href="structmysqlpp_1_1NullIsBlank.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1Null.html">mysqlpp::Null&lt; Type, Behavior &gt;</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Class for holding data from a SQL column with the NULL attribute.  <a href="classmysqlpp_1_1Null.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac214a288279ed7ccfc2c5b6219a83821"><td class="memTemplParams" colspan="2"><a id="ac214a288279ed7ccfc2c5b6219a83821"></a>
template&lt;class Type , class Behavior &gt; </td></tr>
<tr class="memitem:ac214a288279ed7ccfc2c5b6219a83821"><td class="memTemplItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="null_8h.html#ac214a288279ed7ccfc2c5b6219a83821">mysqlpp::operator&lt;&lt;</a> (std::ostream &amp;o, const Null&lt; Type, Behavior &gt; &amp;n)</td></tr>
<tr class="memdesc:ac214a288279ed7ccfc2c5b6219a83821"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts null-able data into a C++ stream if it is not actually null. Otherwise, insert something appropriate for null data. <br /></td></tr>
<tr class="separator:ac214a288279ed7ccfc2c5b6219a83821"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:afe6d3a4c5d24603fa2bde1a36fbc6b86"><td class="memItemLeft" align="right" valign="top"><a id="afe6d3a4c5d24603fa2bde1a36fbc6b86"></a>
const std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="null_8h.html#afe6d3a4c5d24603fa2bde1a36fbc6b86">mysqlpp::null_str</a></td></tr>
<tr class="memdesc:afe6d3a4c5d24603fa2bde1a36fbc6b86"><td class="mdescLeft">&#160;</td><td class="mdescRight">"NULL" string constant <br /></td></tr>
<tr class="separator:afe6d3a4c5d24603fa2bde1a36fbc6b86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a8f2c546401c800672ddcc7fc9abd62"><td class="memItemLeft" align="right" valign="top">const null_type&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="null_8h.html#a1a8f2c546401c800672ddcc7fc9abd62">mysqlpp::null</a> = null_type()</td></tr>
<tr class="memdesc:a1a8f2c546401c800672ddcc7fc9abd62"><td class="mdescLeft">&#160;</td><td class="mdescRight">Global 'null' instance. Use wherever you need a SQL null.  <a href="null_8h.html#a1a8f2c546401c800672ddcc7fc9abd62">More...</a><br /></td></tr>
<tr class="separator:a1a8f2c546401c800672ddcc7fc9abd62"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Declares classes that implement SQL "null" semantics within C++'s type system. </p>
<p>This is required because C++'s own NULL type is not semantically the same as SQL nulls. </p>
</div><h2 class="groupheader">Variable Documentation</h2>
<a id="file_a1a8f2c546401c800672ddcc7fc9abd62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_a1a8f2c546401c800672ddcc7fc9abd62">&#9670;&nbsp;</a></span>null</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const null_type mysqlpp::null = null_type()</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Global 'null' instance. Use wherever you need a SQL null. </p>
<p>SQL null is equal to nothing else. It is not the same as C++'s NULL value, it is not a Boolean false....it is unique. As such, if you use this in some other type context, you will get a compiler error saying something about <code>CannotConvertNullToAnyOtherDataType</code>. The only thing you can assign this object instance to is a variable of type Null&lt;T&gt;, and then only directly. Code like this does not work:</p>
<div class="fragment"><div class="line"><span class="keywordtype">int</span> foo = return_some_value_for_foo();</div><div class="line"><a class="code" href="classmysqlpp_1_1Null.html">mysqlpp::Null&lt;int&gt;</a> bar = foo ? foo : <a class="code" href="null_8h.html#a1a8f2c546401c800672ddcc7fc9abd62">mysqlpp::null</a>;</div></div><!-- fragment --><p>The compiler will try to convert mysqlpp::null to <code>int</code> to make all values in the conditional operation consistent, but this is not legal. Anyway, it's questionable code because it means you're using SQL null to mean the same thing as zero here. If zero is a special value, there's no reason to use SQL null. SQL null exists when every value for a particular column is legal and you need something that means "no legal value". </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Jul 21 2019 05:32:21 for MySQL++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>