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
|
<!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::SQLBuffer 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_1SQLBuffer.html">SQLBuffer</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="classmysqlpp_1_1SQLBuffer-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">mysqlpp::SQLBuffer Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Holds SQL data in string form plus type information for use in converting the string to compatible C++ data types.
<a href="classmysqlpp_1_1SQLBuffer.html#details">More...</a></p>
<p><code>#include <<a class="el" href="sql__buffer_8h_source.html">sql_buffer.h</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a5e789c1879057f4106ee1de6614380a5"><td class="memItemLeft" align="right" valign="top"><a id="a5e789c1879057f4106ee1de6614380a5"></a>
typedef size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a></td></tr>
<tr class="memdesc:a5e789c1879057f4106ee1de6614380a5"><td class="mdescLeft"> </td><td class="mdescRight">Type of length values. <br /></td></tr>
<tr class="separator:a5e789c1879057f4106ee1de6614380a5"><td class="memSeparator" colspan="2"> </td></tr>
</table><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:a4e86b8febc1ab8c889fbd42c3c3dfc49"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a4e86b8febc1ab8c889fbd42c3c3dfc49">SQLBuffer</a> (const char *<a class="el" href="classmysqlpp_1_1SQLBuffer.html#abae32d826be7605448f5480d06974a75">data</a>, <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a559e04e15eb087d2519dc3316584bae7">length</a>, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#afe48e952d2b7d1cc70984cefe0ea21b7">type</a>, bool <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6ec652ab02b2c2499ac66a71da0e19da">is_null</a>)</td></tr>
<tr class="memdesc:a4e86b8febc1ab8c889fbd42c3c3dfc49"><td class="mdescLeft"> </td><td class="mdescRight">Initialize object as a copy of a raw data buffer. <a href="#a4e86b8febc1ab8c889fbd42c3c3dfc49">More...</a><br /></td></tr>
<tr class="separator:a4e86b8febc1ab8c889fbd42c3c3dfc49"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:affbff8bda67d898d47a4df8498fe61b9"><td class="memItemLeft" align="right" valign="top"><a id="affbff8bda67d898d47a4df8498fe61b9"></a>
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#affbff8bda67d898d47a4df8498fe61b9">SQLBuffer</a> (const std::string &s, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#afe48e952d2b7d1cc70984cefe0ea21b7">type</a>, bool <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6ec652ab02b2c2499ac66a71da0e19da">is_null</a>)</td></tr>
<tr class="memdesc:affbff8bda67d898d47a4df8498fe61b9"><td class="mdescLeft"> </td><td class="mdescRight">Initialize object as a copy of a C++ string object. <br /></td></tr>
<tr class="separator:affbff8bda67d898d47a4df8498fe61b9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a41e777868636c20ad09093e1ddb9368a"><td class="memItemLeft" align="right" valign="top"><a id="a41e777868636c20ad09093e1ddb9368a"></a>
 </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a41e777868636c20ad09093e1ddb9368a">~SQLBuffer</a> ()</td></tr>
<tr class="memdesc:a41e777868636c20ad09093e1ddb9368a"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a41e777868636c20ad09093e1ddb9368a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abd3057457a375547d7e82fe4fbacbc45"><td class="memItemLeft" align="right" valign="top"><a id="abd3057457a375547d7e82fe4fbacbc45"></a>
<a class="el" href="classmysqlpp_1_1SQLBuffer.html">SQLBuffer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#abd3057457a375547d7e82fe4fbacbc45">assign</a> (const char *<a class="el" href="classmysqlpp_1_1SQLBuffer.html#abae32d826be7605448f5480d06974a75">data</a>, <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a559e04e15eb087d2519dc3316584bae7">length</a>, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#afe48e952d2b7d1cc70984cefe0ea21b7">type</a>=<a class="el" href="classmysqlpp_1_1mysql__type__info.html#a18d778e786cf06f63a7222129feed227">mysql_type_info::string_type</a>, bool <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6ec652ab02b2c2499ac66a71da0e19da">is_null</a>=false)</td></tr>
<tr class="memdesc:abd3057457a375547d7e82fe4fbacbc45"><td class="mdescLeft"> </td><td class="mdescRight">Replace contents of buffer with copy of given C string. <br /></td></tr>
<tr class="separator:abd3057457a375547d7e82fe4fbacbc45"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a36e353c31f41674a5c21d7a84c404845"><td class="memItemLeft" align="right" valign="top"><a id="a36e353c31f41674a5c21d7a84c404845"></a>
<a class="el" href="classmysqlpp_1_1SQLBuffer.html">SQLBuffer</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a36e353c31f41674a5c21d7a84c404845">assign</a> (const std::string &s, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#afe48e952d2b7d1cc70984cefe0ea21b7">type</a>=<a class="el" href="classmysqlpp_1_1mysql__type__info.html#a18d778e786cf06f63a7222129feed227">mysql_type_info::string_type</a>, bool <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6ec652ab02b2c2499ac66a71da0e19da">is_null</a>=false)</td></tr>
<tr class="memdesc:a36e353c31f41674a5c21d7a84c404845"><td class="mdescLeft"> </td><td class="mdescRight">Replace contents of buffer with copy of given C++ string. <br /></td></tr>
<tr class="separator:a36e353c31f41674a5c21d7a84c404845"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abae32d826be7605448f5480d06974a75"><td class="memItemLeft" align="right" valign="top"><a id="abae32d826be7605448f5480d06974a75"></a>
const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#abae32d826be7605448f5480d06974a75">data</a> () const</td></tr>
<tr class="memdesc:abae32d826be7605448f5480d06974a75"><td class="mdescLeft"> </td><td class="mdescRight">Return pointer to raw data buffer. <br /></td></tr>
<tr class="separator:abae32d826be7605448f5480d06974a75"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab46d62b3b2d94d201eedd40a615adfca"><td class="memItemLeft" align="right" valign="top"><a id="ab46d62b3b2d94d201eedd40a615adfca"></a>
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#ab46d62b3b2d94d201eedd40a615adfca">escape_q</a> () const</td></tr>
<tr class="memdesc:ab46d62b3b2d94d201eedd40a615adfca"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if we were initialized with a data type that must be escaped when used in a SQL query. <br /></td></tr>
<tr class="separator:ab46d62b3b2d94d201eedd40a615adfca"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a559e04e15eb087d2519dc3316584bae7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a559e04e15eb087d2519dc3316584bae7">length</a> () const</td></tr>
<tr class="memdesc:a559e04e15eb087d2519dc3316584bae7"><td class="mdescLeft"> </td><td class="mdescRight">Return number of bytes in data buffer. <a href="#a559e04e15eb087d2519dc3316584bae7">More...</a><br /></td></tr>
<tr class="separator:a559e04e15eb087d2519dc3316584bae7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab077d486f1a873ca0bc2c0e0596e8ca7"><td class="memItemLeft" align="right" valign="top"><a id="ab077d486f1a873ca0bc2c0e0596e8ca7"></a>
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#ab077d486f1a873ca0bc2c0e0596e8ca7">is_string</a> ()</td></tr>
<tr class="memdesc:ab077d486f1a873ca0bc2c0e0596e8ca7"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if type of buffer's contents is string. <br /></td></tr>
<tr class="separator:ab077d486f1a873ca0bc2c0e0596e8ca7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6ec652ab02b2c2499ac66a71da0e19da"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6ec652ab02b2c2499ac66a71da0e19da">is_null</a> () const</td></tr>
<tr class="memdesc:a6ec652ab02b2c2499ac66a71da0e19da"><td class="mdescLeft"> </td><td class="mdescRight">Return true if buffer's contents represent a SQL null. <a href="#a6ec652ab02b2c2499ac66a71da0e19da">More...</a><br /></td></tr>
<tr class="separator:a6ec652ab02b2c2499ac66a71da0e19da"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8fffb0c9ac385d3c54076aa3046a876f"><td class="memItemLeft" align="right" valign="top"><a id="a8fffb0c9ac385d3c54076aa3046a876f"></a>
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a8fffb0c9ac385d3c54076aa3046a876f">quote_q</a> () const</td></tr>
<tr class="memdesc:a8fffb0c9ac385d3c54076aa3046a876f"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if we were initialized with a data type that must be quoted when used in a SQL query. <br /></td></tr>
<tr class="separator:a8fffb0c9ac385d3c54076aa3046a876f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d7f060aea9c7ccd27c6d7a98c29417b"><td class="memItemLeft" align="right" valign="top"><a id="a1d7f060aea9c7ccd27c6d7a98c29417b"></a>
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a1d7f060aea9c7ccd27c6d7a98c29417b">set_null</a> ()</td></tr>
<tr class="memdesc:a1d7f060aea9c7ccd27c6d7a98c29417b"><td class="mdescLeft"> </td><td class="mdescRight">Sets the internal SQL null flag. <br /></td></tr>
<tr class="separator:a1d7f060aea9c7ccd27c6d7a98c29417b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afe48e952d2b7d1cc70984cefe0ea21b7"><td class="memItemLeft" align="right" valign="top"><a id="afe48e952d2b7d1cc70984cefe0ea21b7"></a>
const <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#afe48e952d2b7d1cc70984cefe0ea21b7">type</a> () const</td></tr>
<tr class="memdesc:afe48e952d2b7d1cc70984cefe0ea21b7"><td class="mdescLeft"> </td><td class="mdescRight">Return the SQL type of the data held in the buffer. <br /></td></tr>
<tr class="separator:afe48e952d2b7d1cc70984cefe0ea21b7"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Holds SQL data in string form plus type information for use in converting the string to compatible C++ data types. </p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="a4e86b8febc1ab8c889fbd42c3c3dfc49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e86b8febc1ab8c889fbd42c3c3dfc49">◆ </a></span>SQLBuffer()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">mysqlpp::SQLBuffer::SQLBuffer </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a> </td>
<td class="paramname"><em>length</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> </td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>is_null</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize object as a copy of a raw data buffer. </p>
<p>Copies the string into a new buffer one byte longer than the length value given, using that to hold a C string null terminator, just for safety. The length value we keep does not include this extra byte, allowing this same mechanism to work for both C strings and binary data. </p>
<p class="reference">References <a class="el" href="classmysqlpp_1_1SQLBuffer.html#abae32d826be7605448f5480d06974a75">data()</a>, and <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a559e04e15eb087d2519dc3316584bae7">length()</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a6ec652ab02b2c2499ac66a71da0e19da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ec652ab02b2c2499ac66a71da0e19da">◆ </a></span>is_null()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool mysqlpp::SQLBuffer::is_null </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return true if buffer's contents represent a SQL null. </p>
<p>The buffer's actual content will probably be "NULL" or something like it, but in the SQL data type system, a SQL null is distinct from a plain string with value "NULL". </p>
<p class="reference">Referenced by <a class="el" href="classmysqlpp_1_1SQLBuffer.html#abd3057457a375547d7e82fe4fbacbc45">assign()</a>.</p>
</div>
</div>
<a id="a559e04e15eb087d2519dc3316584bae7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a559e04e15eb087d2519dc3316584bae7">◆ </a></span>length()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a> mysqlpp::SQLBuffer::length </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return number of bytes in data buffer. </p>
<p>Count does not include the trailing null we tack on to our copy of the buffer for ease of use in C string contexts. We do this because we can be holding binary data just as easily as a C string. </p>
<p class="reference">Referenced by <a class="el" href="classmysqlpp_1_1SQLBuffer.html#abd3057457a375547d7e82fe4fbacbc45">assign()</a>, and <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a4e86b8febc1ab8c889fbd42c3c3dfc49">SQLBuffer()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="sql__buffer_8h_source.html">sql_buffer.h</a></li>
<li>sql_buffer.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>
|