File: classmysqlpp_1_1SQLBuffer.html

package info (click to toggle)
mysql%2B%2B 3.0.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 10,328 kB
  • ctags: 9,487
  • sloc: cpp: 33,486; sh: 3,091; perl: 809; makefile: 683
file content (188 lines) | stat: -rw-r--r-- 14,838 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
<!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">
	<link href="refman.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<b>mysqlpp</b>::<a class="el" href="classmysqlpp_1_1SQLBuffer.html">SQLBuffer</a></div>
<h1>mysqlpp::SQLBuffer Class Reference</h1><!-- doxytag: class="mysqlpp::SQLBuffer" -->Holds SQL data in string form plus type information for use in converting the string to compatible C++ data types.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="sql__buffer_8h-source.html">sql_buffer.h</a>&gt;</code>
<p>
Collaboration diagram for mysqlpp::SQLBuffer:<p><center><img src="classmysqlpp_1_1SQLBuffer__coll__graph.png" border="0" usemap="#mysqlpp_1_1SQLBuffer__coll__map" alt="Collaboration graph"></center>
<map name="mysqlpp_1_1SQLBuffer__coll__map">
<area href="classmysqlpp_1_1mysql__type__info.html" shape="rect" coords="5,7,197,31" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classmysqlpp_1_1SQLBuffer-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ead7ba64ac62a5a2905370f69b80e0c5"></a><!-- doxytag: member="mysqlpp::SQLBuffer::size_type" ref="ead7ba64ac62a5a2905370f69b80e0c5" args="" -->
typedef unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#ead7ba64ac62a5a2905370f69b80e0c5">size_type</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Type of length values. <br></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#4e86b8febc1ab8c889fbd42c3c3dfc49">SQLBuffer</a> (const char *data, <a class="el" href="classmysqlpp_1_1SQLBuffer.html#ead7ba64ac62a5a2905370f69b80e0c5">size_type</a> length, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> type, bool is_null)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize object as a copy of a raw data buffer.  <a href="#4e86b8febc1ab8c889fbd42c3c3dfc49"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ffbff8bda67d898d47a4df8498fe61b9"></a><!-- doxytag: member="mysqlpp::SQLBuffer::SQLBuffer" ref="ffbff8bda67d898d47a4df8498fe61b9" args="(const std::string &amp;s, mysql_type_info type, bool is_null)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#ffbff8bda67d898d47a4df8498fe61b9">SQLBuffer</a> (const std::string &amp;s, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> type, bool is_null)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize object as a copy of a C++ string object. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="41e777868636c20ad09093e1ddb9368a"></a><!-- doxytag: member="mysqlpp::SQLBuffer::~SQLBuffer" ref="41e777868636c20ad09093e1ddb9368a" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#41e777868636c20ad09093e1ddb9368a">~SQLBuffer</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bd3057457a375547d7e82fe4fbacbc45"></a><!-- doxytag: member="mysqlpp::SQLBuffer::assign" ref="bd3057457a375547d7e82fe4fbacbc45" args="(const char *data, size_type length, mysql_type_info type=mysql_type_info::string_type, bool is_null=false)" -->
<a class="el" href="classmysqlpp_1_1SQLBuffer.html">SQLBuffer</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#bd3057457a375547d7e82fe4fbacbc45">assign</a> (const char *data, <a class="el" href="classmysqlpp_1_1SQLBuffer.html#ead7ba64ac62a5a2905370f69b80e0c5">size_type</a> length, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> type=<a class="el" href="classmysqlpp_1_1mysql__type__info.html#18d778e786cf06f63a7222129feed227">mysql_type_info::string_type</a>, bool is_null=false)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Replace contents of buffer with copy of given C string. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="36e353c31f41674a5c21d7a84c404845"></a><!-- doxytag: member="mysqlpp::SQLBuffer::assign" ref="36e353c31f41674a5c21d7a84c404845" args="(const std::string &amp;s, mysql_type_info type=mysql_type_info::string_type, bool is_null=false)" -->
<a class="el" href="classmysqlpp_1_1SQLBuffer.html">SQLBuffer</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#36e353c31f41674a5c21d7a84c404845">assign</a> (const std::string &amp;s, <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> type=<a class="el" href="classmysqlpp_1_1mysql__type__info.html#18d778e786cf06f63a7222129feed227">mysql_type_info::string_type</a>, bool is_null=false)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Replace contents of buffer with copy of given C++ string. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ec25bd227cb23caf48c2210013d0f062"></a><!-- doxytag: member="mysqlpp::SQLBuffer::data" ref="ec25bd227cb23caf48c2210013d0f062" args="() const " -->
const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#ec25bd227cb23caf48c2210013d0f062">data</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return pointer to raw data buffer. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a90f561cb6da79c6ec6d5901992fd1b7"></a><!-- doxytag: member="mysqlpp::SQLBuffer::escape_q" ref="a90f561cb6da79c6ec6d5901992fd1b7" args="() const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a90f561cb6da79c6ec6d5901992fd1b7">escape_q</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</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><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#ead7ba64ac62a5a2905370f69b80e0c5">size_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#a2f38c8213db211e2d473aafca9397b4">length</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return number of bytes in data buffer.  <a href="#a2f38c8213db211e2d473aafca9397b4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b077d486f1a873ca0bc2c0e0596e8ca7"></a><!-- doxytag: member="mysqlpp::SQLBuffer::is_string" ref="b077d486f1a873ca0bc2c0e0596e8ca7" args="()" -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#b077d486f1a873ca0bc2c0e0596e8ca7">is_string</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if type of buffer's contents is string. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#6189b995dad7f0128599e0635d031b3d">is_null</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return true if buffer's contents represent a SQL null.  <a href="#6189b995dad7f0128599e0635d031b3d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bbdd3371fd3e0419cfe6fbbcccbf8d15"></a><!-- doxytag: member="mysqlpp::SQLBuffer::quote_q" ref="bbdd3371fd3e0419cfe6fbbcccbf8d15" args="() const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#bbdd3371fd3e0419cfe6fbbcccbf8d15">quote_q</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</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><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1d7f060aea9c7ccd27c6d7a98c29417b"></a><!-- doxytag: member="mysqlpp::SQLBuffer::set_null" ref="1d7f060aea9c7ccd27c6d7a98c29417b" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#1d7f060aea9c7ccd27c6d7a98c29417b">set_null</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the internal SQL null flag. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4a07b1f1eb32a2104b032550b0a97062"></a><!-- doxytag: member="mysqlpp::SQLBuffer::type" ref="4a07b1f1eb32a2104b032550b0a97062" args="() const " -->
const <a class="el" href="classmysqlpp_1_1mysql__type__info.html">mysql_type_info</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#4a07b1f1eb32a2104b032550b0a97062">type</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the SQL type of the data held in the buffer. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Holds SQL data in string form plus type information for use in converting the string to compatible C++ data types. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="4e86b8febc1ab8c889fbd42c3c3dfc49"></a><!-- doxytag: member="mysqlpp::SQLBuffer::SQLBuffer" ref="4e86b8febc1ab8c889fbd42c3c3dfc49" args="(const char *data, size_type length, mysql_type_info type, bool is_null)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">mysqlpp::SQLBuffer::SQLBuffer           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</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#ead7ba64ac62a5a2905370f69b80e0c5">size_type</a>&nbsp;</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>&nbsp;</td>
          <td class="paramname"> <em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>is_null</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initialize object as a copy of a raw data buffer. 
<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. 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="6189b995dad7f0128599e0635d031b3d"></a><!-- doxytag: member="mysqlpp::SQLBuffer::is_null" ref="6189b995dad7f0128599e0635d031b3d" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool mysqlpp::SQLBuffer::is_null           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return true if buffer's contents represent a SQL null. 
<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". 
</div>
</div><p>
<a class="anchor" name="a2f38c8213db211e2d473aafca9397b4"></a><!-- doxytag: member="mysqlpp::SQLBuffer::length" ref="a2f38c8213db211e2d473aafca9397b4" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classmysqlpp_1_1SQLBuffer.html#ead7ba64ac62a5a2905370f69b80e0c5">size_type</a> mysqlpp::SQLBuffer::length           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return number of bytes in data buffer. 
<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. 
</div>
</div><p>
<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>sql_buffer.cpp</ul>
<hr size="1"><address style="align: right;"><small>Generated on Fri Feb 29 16:26:49 2008 for MySQL++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>