File: classmysqlpp_1_1SQLBuffer.html

package info (click to toggle)
mysql%2B%2B 3.2.2%2Bpristine-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 15,724 kB
  • ctags: 10,567
  • sloc: cpp: 35,668; sh: 3,683; makefile: 846; perl: 786
file content (225 lines) | stat: -rwxr-xr-x 18,328 bytes parent folder | download
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
<!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&#160;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&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;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_1SQLBuffer.html">SQLBuffer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<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 &lt;<a class="el" href="sql__buffer_8h_source.html">sql_buffer.h</a>&gt;</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 class="anchor" id="a5e789c1879057f4106ee1de6614380a5"></a>
typedef size_t&#160;</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">&#160;</td><td class="mdescRight">Type of length values. <br/></td></tr>
<tr class="separator:a5e789c1879057f4106ee1de6614380a5"><td class="memSeparator" colspan="2">&#160;</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">&#160;</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#aec25bd227cb23caf48c2210013d0f062">data</a>, <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#aa2f38c8213db211e2d473aafca9397b4">length</a>, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a4a07b1f1eb32a2104b032550b0a97062">type</a>, bool <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6189b995dad7f0128599e0635d031b3d">is_null</a>)</td></tr>
<tr class="memdesc:a4e86b8febc1ab8c889fbd42c3c3dfc49"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:affbff8bda67d898d47a4df8498fe61b9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="affbff8bda67d898d47a4df8498fe61b9"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#affbff8bda67d898d47a4df8498fe61b9">SQLBuffer</a> (const std::string &amp;s, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a4a07b1f1eb32a2104b032550b0a97062">type</a>, bool <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6189b995dad7f0128599e0635d031b3d">is_null</a>)</td></tr>
<tr class="memdesc:affbff8bda67d898d47a4df8498fe61b9"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:a41e777868636c20ad09093e1ddb9368a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a41e777868636c20ad09093e1ddb9368a"></a>
&#160;</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">&#160;</td><td class="mdescRight">Destructor. <br/></td></tr>
<tr class="separator:a41e777868636c20ad09093e1ddb9368a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd3057457a375547d7e82fe4fbacbc45"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd3057457a375547d7e82fe4fbacbc45"></a>
<a class="el" href="classmysqlpp_1_1SQLBuffer.html">SQLBuffer</a> &amp;&#160;</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#aec25bd227cb23caf48c2210013d0f062">data</a>, <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#aa2f38c8213db211e2d473aafca9397b4">length</a>, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a4a07b1f1eb32a2104b032550b0a97062">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#a6189b995dad7f0128599e0635d031b3d">is_null</a>=false)</td></tr>
<tr class="memdesc:abd3057457a375547d7e82fe4fbacbc45"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:a36e353c31f41674a5c21d7a84c404845"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a36e353c31f41674a5c21d7a84c404845"></a>
<a class="el" href="classmysqlpp_1_1SQLBuffer.html">SQLBuffer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a36e353c31f41674a5c21d7a84c404845">assign</a> (const std::string &amp;s, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> <a class="el" href="classmysqlpp_1_1SQLBuffer.html#a4a07b1f1eb32a2104b032550b0a97062">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#a6189b995dad7f0128599e0635d031b3d">is_null</a>=false)</td></tr>
<tr class="memdesc:a36e353c31f41674a5c21d7a84c404845"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:aec25bd227cb23caf48c2210013d0f062"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aec25bd227cb23caf48c2210013d0f062"></a>
const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#aec25bd227cb23caf48c2210013d0f062">data</a> () const </td></tr>
<tr class="memdesc:aec25bd227cb23caf48c2210013d0f062"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return pointer to raw data buffer. <br/></td></tr>
<tr class="separator:aec25bd227cb23caf48c2210013d0f062"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa90f561cb6da79c6ec6d5901992fd1b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa90f561cb6da79c6ec6d5901992fd1b7"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#aa90f561cb6da79c6ec6d5901992fd1b7">escape_q</a> () const </td></tr>
<tr class="memdesc:aa90f561cb6da79c6ec6d5901992fd1b7"><td class="mdescLeft">&#160;</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:aa90f561cb6da79c6ec6d5901992fd1b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2f38c8213db211e2d473aafca9397b4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a5e789c1879057f4106ee1de6614380a5">size_type</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#aa2f38c8213db211e2d473aafca9397b4">length</a> () const </td></tr>
<tr class="memdesc:aa2f38c8213db211e2d473aafca9397b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return number of bytes in data buffer.  <a href="#aa2f38c8213db211e2d473aafca9397b4">More...</a><br/></td></tr>
<tr class="separator:aa2f38c8213db211e2d473aafca9397b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab077d486f1a873ca0bc2c0e0596e8ca7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab077d486f1a873ca0bc2c0e0596e8ca7"></a>
bool&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a6189b995dad7f0128599e0635d031b3d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a6189b995dad7f0128599e0635d031b3d">is_null</a> () const </td></tr>
<tr class="memdesc:a6189b995dad7f0128599e0635d031b3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if buffer's contents represent a SQL null.  <a href="#a6189b995dad7f0128599e0635d031b3d">More...</a><br/></td></tr>
<tr class="separator:a6189b995dad7f0128599e0635d031b3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abbdd3371fd3e0419cfe6fbbcccbf8d15"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abbdd3371fd3e0419cfe6fbbcccbf8d15"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#abbdd3371fd3e0419cfe6fbbcccbf8d15">quote_q</a> () const </td></tr>
<tr class="memdesc:abbdd3371fd3e0419cfe6fbbcccbf8d15"><td class="mdescLeft">&#160;</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:abbdd3371fd3e0419cfe6fbbcccbf8d15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d7f060aea9c7ccd27c6d7a98c29417b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1d7f060aea9c7ccd27c6d7a98c29417b"></a>
void&#160;</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">&#160;</td><td class="mdescRight">Sets the internal SQL null flag. <br/></td></tr>
<tr class="separator:a1d7f060aea9c7ccd27c6d7a98c29417b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a07b1f1eb32a2104b032550b0a97062"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a07b1f1eb32a2104b032550b0a97062"></a>
const <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a4a07b1f1eb32a2104b032550b0a97062">type</a> () const </td></tr>
<tr class="memdesc:a4a07b1f1eb32a2104b032550b0a97062"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the SQL type of the data held in the buffer. <br/></td></tr>
<tr class="separator:a4a07b1f1eb32a2104b032550b0a97062"><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>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 &amp; Destructor Documentation</h2>
<a class="anchor" id="a4e86b8febc1ab8c889fbd42c3c3dfc49"></a>
<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 *&#160;</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>&#160;</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>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>is_null</em>&#160;</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>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a6189b995dad7f0128599e0635d031b3d"></a>
<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>Referenced by <a class="el" href="classmysqlpp_1_1SQLBuffer.html#abd3057457a375547d7e82fe4fbacbc45">assign()</a>, and <a class="el" href="classmysqlpp_1_1String.html#aae1a09ac03c7aedb4ce8242b64c99105">mysqlpp::String::is_null()</a>.</p>

</div>
</div>
<a class="anchor" id="aa2f38c8213db211e2d473aafca9397b4"></a>
<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>Referenced by <a class="el" href="classmysqlpp_1_1String.html#ac45da6949d25235fb08146cc54423184">mysqlpp::String::end()</a>, <a class="el" href="classmysqlpp_1_1SQLTypeAdapter.html#afed8e311f6481ee92f51d9cb0fe689f5">mysqlpp::SQLTypeAdapter::length()</a>, <a class="el" href="classmysqlpp_1_1String.html#a631286a235165cc9c2b653b5d852f65c">mysqlpp::String::length()</a>, and <a class="el" href="classmysqlpp_1_1String.html#a5832628cdfc820e57ddd44f16ad6c282">mysqlpp::String::to_string()</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 Wed Mar 18 2015 18:55:03 for MySQL++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>