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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
|
<!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++: manip.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++
 <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&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&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="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">manip.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Declares the Query stream manipulators and operators.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include "<a class="el" href="common_8h_source.html">common.h</a>"</code><br />
<code>#include "<a class="el" href="myset_8h_source.html">myset.h</a>"</code><br />
<code>#include "<a class="el" href="stadapter_8h_source.html">stadapter.h</a>"</code><br />
<code>#include <iostream></code><br />
</div>
<p><a href="manip_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="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ae9f9a1a0b5b6c666cc577ac4ea30f2f8"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="manip_8h.html#ae9f9a1a0b5b6c666cc577ac4ea30f2f8">mysqlpp::quote_type0</a> { <a class="el" href="manip_8h.html#ae9f9a1a0b5b6c666cc577ac4ea30f2f8abc8a579670da714d08fece6f43b11b53">mysqlpp::quote</a>
}</td></tr>
<tr class="separator:ae9f9a1a0b5b6c666cc577ac4ea30f2f8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac6684f37ebc2f5dc4b526f1858938ae0"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="manip_8h.html#ac6684f37ebc2f5dc4b526f1858938ae0">mysqlpp::quote_only_type0</a> { <a class="el" href="manip_8h.html#ac6684f37ebc2f5dc4b526f1858938ae0af77dc617bf2f8715000fea02996eb703">mysqlpp::quote_only</a>
}</td></tr>
<tr class="separator:ac6684f37ebc2f5dc4b526f1858938ae0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab7c0f5b960b8c68a5bb6615908f8fb4f"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="manip_8h.html#ab7c0f5b960b8c68a5bb6615908f8fb4f">mysqlpp::quote_double_only_type0</a> { <a class="el" href="manip_8h.html#ab7c0f5b960b8c68a5bb6615908f8fb4fade9ec989c0afd3cb18e23689f17f74ed">mysqlpp::quote_double_only</a>
}</td></tr>
<tr class="separator:ab7c0f5b960b8c68a5bb6615908f8fb4f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae85db9a9abb211c818c9c3c1241bd660"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="manip_8h.html#ae85db9a9abb211c818c9c3c1241bd660">mysqlpp::escape_type0</a> { <b>escape</b>
}</td></tr>
<tr class="separator:ae85db9a9abb211c818c9c3c1241bd660"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acabd5572224baf2f7c26f89bc082673f"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="manip_8h.html#acabd5572224baf2f7c26f89bc082673f">mysqlpp::do_nothing_type0</a> { <a class="el" href="manip_8h.html#acabd5572224baf2f7c26f89bc082673fae465f6c0ca597e0ab6332883b7b5f00d">mysqlpp::do_nothing</a>
}</td></tr>
<tr class="separator:acabd5572224baf2f7c26f89bc082673f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aecf53d5cc6a2962626f69dd69e45845f"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="manip_8h.html#aecf53d5cc6a2962626f69dd69e45845f">mysqlpp::ignore_type0</a> { <a class="el" href="manip_8h.html#aecf53d5cc6a2962626f69dd69e45845fa2a90c97a62d76da373d485b2abf3b02a">mysqlpp::ignore</a>
}</td></tr>
<tr class="separator:aecf53d5cc6a2962626f69dd69e45845f"><td class="memSeparator" colspan="2"> </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:aca9b938dd5aaec8ba0f92ba2ca08d212"><td class="memItemLeft" align="right" valign="top">SQLQueryParms & </td><td class="memItemRight" valign="bottom"><b>mysqlpp::operator<<</b> (escape_type2 p, SQLTypeAdapter &in)</td></tr>
<tr class="memdesc:aca9b938dd5aaec8ba0f92ba2ca08d212"><td class="mdescLeft"> </td><td class="mdescRight">Inserts a <a class="el" href="classmysqlpp_1_1SQLTypeAdapter.html" title="Converts many different data types to strings suitable for use in SQL queries.">SQLTypeAdapter</a> into a stream, escaping special SQL characters. <a href="manip_8cpp.html#aca9b938dd5aaec8ba0f92ba2ca08d212">More...</a><br /></td></tr>
<tr class="separator:aca9b938dd5aaec8ba0f92ba2ca08d212"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a570ed1997f58aa381d5ee1d9e99fca88"><td class="memItemLeft" align="right" valign="top"><a id="a570ed1997f58aa381d5ee1d9e99fca88"></a>
ostream & </td><td class="memItemRight" valign="bottom"><b>mysqlpp::operator<<</b> (escape_type1 o, const SQLTypeAdapter &in)</td></tr>
<tr class="memdesc:a570ed1997f58aa381d5ee1d9e99fca88"><td class="mdescLeft"> </td><td class="mdescRight">Inserts anything that can be converted to <a class="el" href="classmysqlpp_1_1SQLTypeAdapter.html" title="Converts many different data types to strings suitable for use in SQL queries.">SQLTypeAdapter</a> into a stream, escaping special SQL characters as needed. <br /></td></tr>
<tr class="separator:a570ed1997f58aa381d5ee1d9e99fca88"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Declares the Query stream manipulators and operators. </p>
<p>These manipulators let you automatically quote elements or escape characters that are special in SQL when inserting them into a Query stream. They make it easier to build syntactically-correct SQL queries.</p>
<p>This file also includes special <code>operator<<</code> definitions for a few key MySQL++ data types, since we know when to do automatic quoting and escaping for these types. This only works with Query streams, not regular std::ostreams, since we're only concerned with making correct SQL, not with presentation matters.</p>
<p>test/test_manip.cpp exercises the mechanisms defined here. </p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="file_acabd5572224baf2f7c26f89bc082673f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_acabd5572224baf2f7c26f89bc082673f">◆ </a></span>do_nothing_type0</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="manip_8h.html#acabd5572224baf2f7c26f89bc082673f">mysqlpp::do_nothing_type0</a></td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="anchor" id="do_nothing_manip"></a> The 'do_nothing' manipulator.</p>
<p>Does exactly what it says: nothing. Used as a dummy manipulator when you are required to use some manipulator but don't want anything to be done to the following item. When used with SQLQueryParms it will make sure that it does not get formatted in any way, overriding any setting set by the template query. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="acabd5572224baf2f7c26f89bc082673fae465f6c0ca597e0ab6332883b7b5f00d"></a>do_nothing </td><td class="fielddoc"><p>insert into a std::ostream to override manipulation of next item </p>
</td></tr>
</table>
</div>
</div>
<a id="file_ae85db9a9abb211c818c9c3c1241bd660"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_ae85db9a9abb211c818c9c3c1241bd660">◆ </a></span>escape_type0</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="manip_8h.html#ae85db9a9abb211c818c9c3c1241bd660">mysqlpp::escape_type0</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The 'escape' manipulator.</p>
<p>SQL-escapes following argument if it is of a data type that may require escaping when inserted into a Query or SQLQueryParms stream. This is useful with string types, for example, to avoid bad SQL when they contain special characters like single quotes, nulls, and newlines. Data types like integers which never benefit from escaping don't get run through the escaping routine even if you ask for it. </p>
</div>
</div>
<a id="file_aecf53d5cc6a2962626f69dd69e45845f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_aecf53d5cc6a2962626f69dd69e45845f">◆ </a></span>ignore_type0</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="manip_8h.html#aecf53d5cc6a2962626f69dd69e45845f">mysqlpp::ignore_type0</a></td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="anchor" id="ignore_manip"></a> The 'ignore' manipulator.</p>
<p>Only valid when used with SQLQueryParms. It's a dummy manipulator like the <a href="#do_nothing_manip">do_nothing manipulator</a>, except that it will not override formatting set by the template query. It is simply ignored. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aecf53d5cc6a2962626f69dd69e45845fa2a90c97a62d76da373d485b2abf3b02a"></a>ignore </td><td class="fielddoc"><p>insert into a std::ostream as a dummy manipulator </p>
</td></tr>
</table>
</div>
</div>
<a id="file_ab7c0f5b960b8c68a5bb6615908f8fb4f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_ab7c0f5b960b8c68a5bb6615908f8fb4f">◆ </a></span>quote_double_only_type0</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="manip_8h.html#ab7c0f5b960b8c68a5bb6615908f8fb4f">mysqlpp::quote_double_only_type0</a></td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="anchor" id="quote_double_manip"></a> The 'double_quote_only' manipulator.</p>
<p>Similar to <a href="#quote_only_manip">quote_only manipulator</a>, except that it uses double quotes instead of single quotes.</p>
<p>You might care to use it when you have MySQL's <code>ANSI_QUOTES</code> mode enabled. In that mode, single quotes are used only for string literals, and double quotes for identifiers. Otherwise, <code>quote_only</code> and <code>quote</code> are quite sufficient. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ab7c0f5b960b8c68a5bb6615908f8fb4fade9ec989c0afd3cb18e23689f17f74ed"></a>quote_double_only </td><td class="fielddoc"><p>insert into a std::ostream to double-quote next item </p>
</td></tr>
</table>
</div>
</div>
<a id="file_ac6684f37ebc2f5dc4b526f1858938ae0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_ac6684f37ebc2f5dc4b526f1858938ae0">◆ </a></span>quote_only_type0</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="manip_8h.html#ac6684f37ebc2f5dc4b526f1858938ae0">mysqlpp::quote_only_type0</a></td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="anchor" id="quote_only_manip"></a> The 'quote_only' manipulator.</p>
<p>Similar to <a href="#quote_manip">quote manipulator</a>, except that it doesn't escape special SQL characters. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac6684f37ebc2f5dc4b526f1858938ae0af77dc617bf2f8715000fea02996eb703"></a>quote_only </td><td class="fielddoc"><p>insert into a std::ostream to single-quote next item </p>
</td></tr>
</table>
</div>
</div>
<a id="file_ae9f9a1a0b5b6c666cc577ac4ea30f2f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_ae9f9a1a0b5b6c666cc577ac4ea30f2f8">◆ </a></span>quote_type0</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="manip_8h.html#ae9f9a1a0b5b6c666cc577ac4ea30f2f8">mysqlpp::quote_type0</a></td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="anchor" id="quote_manip"></a> The standard 'quote' manipulator. It is the most widely useful manipulator in MySQL++.</p>
<p>Insert this manipulator into a Query or SQLQueryParms stream to put single quotes around the next item in the stream, and escape any characters within it that are special in SQL, if the data type of the next item in the stream may require it. By contrast, Date objects only require escaping, not quoting, and integers never require either. The manipulators won't do work they know is not necessary to ensure syntactially-correct SQL. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ae9f9a1a0b5b6c666cc577ac4ea30f2f8abc8a579670da714d08fece6f43b11b53"></a>quote </td><td class="fielddoc"><p>insert into a <a class="el" href="classmysqlpp_1_1Query.html" title="A class for building and executing SQL queries.">Query</a> stream to single-quote and escape next item </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="file_aca9b938dd5aaec8ba0f92ba2ca08d212"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_aca9b938dd5aaec8ba0f92ba2ca08d212">◆ </a></span>operator<<()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">MYSQLPP_EXPORT SQLQueryParms & mysqlpp::operator<< </td>
<td>(</td>
<td class="paramtype">escape_type2 </td>
<td class="paramname"><em>p</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmysqlpp_1_1SQLTypeAdapter.html">SQLTypeAdapter</a> & </td>
<td class="paramname"><em>in</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Inserts a SQLTypeAdapter into a stream, escaping special SQL characters. </p>
<p>We actually only do the escaping if in.escape_q() returns true but in.dont_escape is not. If that is not the case, we insert the string data directly. </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  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
|