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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
|
<!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++: mysqlpp::SQLStream Class 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 id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>mysqlpp</b></li><li class="navelem"><a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-attribs">Public Attributes</a> |
<a href="classmysqlpp_1_1SQLStream-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mysqlpp::SQLStream Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A class for building SQL-formatted strings.
<a href="classmysqlpp_1_1SQLStream.html#details">More...</a></p>
<p><code>#include <<a class="el" href="sqlstream_8h_source.html">sqlstream.h</a>></code></p>
<div class="dynheader">
Inheritance diagram for mysqlpp::SQLStream:</div>
<div class="dyncontent">
<div class="center"><img src="classmysqlpp_1_1SQLStream__inherit__graph.png" border="0" usemap="#mysqlpp_1_1SQLStream_inherit__map" alt="Inheritance graph"/></div>
<map name="mysqlpp_1_1SQLStream_inherit__map" id="mysqlpp_1_1SQLStream_inherit__map">
<area shape="rect" title="A class for building SQL-formatted strings." alt="" coords="5,79,153,104"/>
<area shape="rect" title=" " alt="" coords="16,5,143,31"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for mysqlpp::SQLStream:</div>
<div class="dyncontent">
<div class="center"><img src="classmysqlpp_1_1SQLStream__coll__graph.png" border="0" usemap="#mysqlpp_1_1SQLStream_coll__map" alt="Collaboration graph"/></div>
<map name="mysqlpp_1_1SQLStream_coll__map" id="mysqlpp_1_1SQLStream_coll__map">
<area shape="rect" title="A class for building SQL-formatted strings." alt="" coords="16,179,164,204"/>
<area shape="rect" title=" " alt="" coords="5,92,133,117"/>
<area shape="rect" href="classmysqlpp_1_1Connection.html" title="Manages the connection to the database server." alt="" coords="156,92,302,117"/>
<area shape="rect" href="classmysqlpp_1_1OptionalExceptions.html" title="Interface allowing a class to have optional exceptions." alt="" coords="59,5,252,31"/>
<area shape="rect" title=" " alt="" coords="277,5,331,31"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad5c7fbaf7deb94157dcb71f1efe4596b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#ad5c7fbaf7deb94157dcb71f1efe4596b">SQLStream</a> (<a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> *c, const char *pstr=0)</td></tr>
<tr class="memdesc:ad5c7fbaf7deb94157dcb71f1efe4596b"><td class="mdescLeft"> </td><td class="mdescRight">Create a new stream object attached to a connection. <a href="#ad5c7fbaf7deb94157dcb71f1efe4596b">More...</a><br /></td></tr>
<tr class="separator:ad5c7fbaf7deb94157dcb71f1efe4596b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0e13aec37b6179e439bf2a9acec87151"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#a0e13aec37b6179e439bf2a9acec87151">SQLStream</a> (const <a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> &s)</td></tr>
<tr class="memdesc:a0e13aec37b6179e439bf2a9acec87151"><td class="mdescLeft"> </td><td class="mdescRight">Create a new stream object as a copy of another. <a href="#a0e13aec37b6179e439bf2a9acec87151">More...</a><br /></td></tr>
<tr class="separator:a0e13aec37b6179e439bf2a9acec87151"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6e29b4815905252a66ebf6a521dc2e1c"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#a6e29b4815905252a66ebf6a521dc2e1c">escape_string</a> (std::string *ps, const char *original=0, size_t length=0) const</td></tr>
<tr class="memdesc:a6e29b4815905252a66ebf6a521dc2e1c"><td class="mdescLeft"> </td><td class="mdescRight">Return a SQL-escaped version of a character buffer. <a href="#a6e29b4815905252a66ebf6a521dc2e1c">More...</a><br /></td></tr>
<tr class="separator:a6e29b4815905252a66ebf6a521dc2e1c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5906b8be3d7ee86d947c5fd52f0c55cb"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#a5906b8be3d7ee86d947c5fd52f0c55cb">escape_string</a> (char *escaped, const char *original, size_t length) const</td></tr>
<tr class="memdesc:a5906b8be3d7ee86d947c5fd52f0c55cb"><td class="mdescLeft"> </td><td class="mdescRight">Return a SQL-escaped version of the given character buffer. <a href="#a5906b8be3d7ee86d947c5fd52f0c55cb">More...</a><br /></td></tr>
<tr class="separator:a5906b8be3d7ee86d947c5fd52f0c55cb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a48bd3485fca317bfef9b21405aca78d2"><td class="memItemLeft" align="right" valign="top"><a id="a48bd3485fca317bfef9b21405aca78d2"></a>
<a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#a48bd3485fca317bfef9b21405aca78d2">operator=</a> (const <a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> &rhs)</td></tr>
<tr class="memdesc:a48bd3485fca317bfef9b21405aca78d2"><td class="mdescLeft"> </td><td class="mdescRight">Assigns contents of another <a class="el" href="classmysqlpp_1_1SQLStream.html" title="A class for building SQL-formatted strings.">SQLStream</a> to this one. <br /></td></tr>
<tr class="separator:a48bd3485fca317bfef9b21405aca78d2"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a58377cc5c3925dd87be081d47e021d79"><td class="memItemLeft" align="right" valign="top"><a id="a58377cc5c3925dd87be081d47e021d79"></a>
<a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#a58377cc5c3925dd87be081d47e021d79">conn_</a></td></tr>
<tr class="memdesc:a58377cc5c3925dd87be081d47e021d79"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classmysqlpp_1_1Connection.html" title="Manages the connection to the database server.">Connection</a> to send queries through. <br /></td></tr>
<tr class="separator:a58377cc5c3925dd87be081d47e021d79"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A class for building SQL-formatted strings. </p>
<p>See the user manual for more details about these options. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="ad5c7fbaf7deb94157dcb71f1efe4596b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5c7fbaf7deb94157dcb71f1efe4596b">◆ </a></span>SQLStream() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mysqlpp::SQLStream::SQLStream </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>pstr</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a new stream object attached to a connection. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>connection used for escaping text </td></tr>
<tr><td class="paramname">pstr</td><td>an optional initial string </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a0e13aec37b6179e439bf2a9acec87151"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e13aec37b6179e439bf2a9acec87151">◆ </a></span>SQLStream() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">mysqlpp::SQLStream::SQLStream </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> & </td>
<td class="paramname"><em>s</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a new stream object as a copy of another. </p>
<p>This is a traditional copy ctor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a6e29b4815905252a66ebf6a521dc2e1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e29b4815905252a66ebf6a521dc2e1c">◆ </a></span>escape_string() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t mysqlpp::SQLStream::escape_string </td>
<td>(</td>
<td class="paramtype">std::string * </td>
<td class="paramname"><em>ps</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>original</em> = <code>0</code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>length</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return a SQL-escaped version of a character buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ps</td><td>pointer to C++ string to hold escaped version; if original is 0, also holds the original data to be escaped </td></tr>
<tr><td class="paramname">original</td><td>if given, pointer to the character buffer to escape instead of contents of *ps </td></tr>
<tr><td class="paramname">length</td><td>if both this and original are given, number of characters to escape instead of ps->length()</td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">number</td><td>of characters placed in *ps</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd>comments for escape_string(char*, const char*, size_t) and <a class="el" href="classmysqlpp_1_1DBDriver.html#a64b30d25d02719ffc22f9b3ba92cdd89" title="Return a SQL-escaped version of a character buffer.">DBDriver::escape_string(std::string*, const char *, size_t)</a> for further details. </dd></dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1SQLStream.html#a58377cc5c3925dd87be081d47e021d79">conn_</a>, <a class="el" href="classmysqlpp_1_1Connection.html#a0d118df40a7bd4bb63e7286b221f7680">mysqlpp::Connection::driver()</a>, <a class="el" href="classmysqlpp_1_1DBDriver.html#a69881b0fab7f7d10c1d1adc7aacbbd6a">mysqlpp::DBDriver::escape_string()</a>, and <a class="el" href="classmysqlpp_1_1DBDriver.html#a2a404051fc2cc55b9e1f41cfe47190f3">mysqlpp::DBDriver::escape_string_no_conn()</a>.</p>
</div>
</div>
<a id="a5906b8be3d7ee86d947c5fd52f0c55cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5906b8be3d7ee86d947c5fd52f0c55cb">◆ </a></span>escape_string() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t mysqlpp::SQLStream::escape_string </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"><em>escaped</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>original</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>length</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return a SQL-escaped version of the given character buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">escaped</td><td>character buffer to hold escaped version; must point to at least (length * 2 + 1) bytes </td></tr>
<tr><td class="paramname">original</td><td>pointer to the character buffer to escape </td></tr>
<tr><td class="paramname">length</td><td>number of characters to escape</td></tr>
</table>
</dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">number</td><td>of characters placed in escaped</td></tr>
</table>
</dd>
</dl>
<p><a class="el" href="classmysqlpp_1_1DBDriver.html" title="Provides a thin abstraction layer over the underlying database client library.">DBDriver</a> provides two versions of this method and <a class="el" href="classmysqlpp_1_1Query.html#a02a2c704dedd789c781b7b10420f82e7" title="Return a SQL-escaped version of a character buffer.">Query::escape_string()</a> calls the appropriate one based on whether or not a database connection is available. If the connection is available, it can call the <a class="el" href="classmysqlpp_1_1DBDriver.html#a69881b0fab7f7d10c1d1adc7aacbbd6a" title="Return a SQL-escaped version of the given character buffer.">DBDriver::escape_string()</a> method. If there is no database connection available (normally only in testing), then <a class="el" href="classmysqlpp_1_1DBDriver.html" title="Provides a thin abstraction layer over the underlying database client library.">DBDriver</a> provides a static version of the function that doesn't use a database connection.</p>
<dl class="section see"><dt>See also</dt><dd>comments for <a class="el" href="classmysqlpp_1_1DBDriver.html#a69881b0fab7f7d10c1d1adc7aacbbd6a" title="Return a SQL-escaped version of the given character buffer.">DBDriver::escape_string(char*, const char*, size_t)</a>, <a class="el" href="classmysqlpp_1_1DBDriver.html#a2a404051fc2cc55b9e1f41cfe47190f3" title="SQL-escapes the given string without reference to the character set of a database server.">DBDriver::escape_string_no_conn(char*, const char*, size_t)</a> for further details. </dd></dl>
<p class="reference">References <a class="el" href="classmysqlpp_1_1SQLStream.html#a58377cc5c3925dd87be081d47e021d79">conn_</a>, <a class="el" href="classmysqlpp_1_1Connection.html#a0d118df40a7bd4bb63e7286b221f7680">mysqlpp::Connection::driver()</a>, <a class="el" href="classmysqlpp_1_1DBDriver.html#a69881b0fab7f7d10c1d1adc7aacbbd6a">mysqlpp::DBDriver::escape_string()</a>, and <a class="el" href="classmysqlpp_1_1DBDriver.html#a2a404051fc2cc55b9e1f41cfe47190f3">mysqlpp::DBDriver::escape_string_no_conn()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="sqlstream_8h_source.html">sqlstream.h</a></li>
<li>sqlstream.cpp</li>
</ul>
</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>
|