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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>MySQL++ Reference Manual</title>
<meta http-equiv="Content-type" content="text/html;charset=iso-8859-1">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.8.5 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</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>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</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>
<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" id="node3" href="classmysqlpp_1_1Connection.html" title="Manages the connection to the database server. " alt="" coords="155,96,300,123"/><area shape="rect" id="node4" href="classmysqlpp_1_1OptionalExceptions.html" title="Interface allowing a class to have optional exceptions. " alt="" coords="57,5,249,32"/></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:ab41f043f8d4c8918805eb21b3bd1f8ab"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#ab41f043f8d4c8918805eb21b3bd1f8ab">escape_string</a> (std::string *ps, const char *original=0, size_t length=0) const </td></tr>
<tr class="memdesc:ab41f043f8d4c8918805eb21b3bd1f8ab"><td class="mdescLeft"> </td><td class="mdescRight">Return a SQL-escaped version of a character buffer. <a href="#ab41f043f8d4c8918805eb21b3bd1f8ab">More...</a><br/></td></tr>
<tr class="separator:ab41f043f8d4c8918805eb21b3bd1f8ab"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a382c8418c3e03b11b592d48ee7832f72"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#a382c8418c3e03b11b592d48ee7832f72">escape_string</a> (char *escaped, const char *original, size_t length) const </td></tr>
<tr class="memdesc:a382c8418c3e03b11b592d48ee7832f72"><td class="mdescLeft"> </td><td class="mdescRight">Return a SQL-escaped version of the given character buffer. <a href="#a382c8418c3e03b11b592d48ee7832f72">More...</a><br/></td></tr>
<tr class="separator:a382c8418c3e03b11b592d48ee7832f72"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a48bd3485fca317bfef9b21405aca78d2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" 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 class="anchor" 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 class="anchor" id="ad5c7fbaf7deb94157dcb71f1efe4596b"></a>
<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 class="anchor" id="a0e13aec37b6179e439bf2a9acec87151"></a>
<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 class="anchor" id="ab41f043f8d4c8918805eb21b3bd1f8ab"></a>
<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>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 class="anchor" id="a382c8418c3e03b11b592d48ee7832f72"></a>
<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#adc7d259cbf78f1e418b7ad12751c5342" 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>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 Wed Mar 18 2015 18:55:03 for MySQL++ by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
|