File: classmysqlpp_1_1SQLStream.html

package info (click to toggle)
mysql%2B%2B 3.1.0-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,640 kB
  • sloc: cpp: 35,569; sh: 3,113; makefile: 946; perl: 786
file content (235 lines) | stat: -rw-r--r-- 13,802 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
226
227
228
229
230
231
232
233
234
235
<!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><a href="namespaces.html"><span>Namespaces</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_1SQLStream.html">SQLStream</a></div>
<h1>mysqlpp::SQLStream Class Reference</h1><!-- doxytag: class="mysqlpp::SQLStream" -->A class for building SQL-formatted strings.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="sqlstream_8h-source.html">sqlstream.h</a>&gt;</code>
<p>
Collaboration diagram for mysqlpp::SQLStream:<p><center><img src="classmysqlpp_1_1SQLStream__coll__graph.png" border="0" usemap="#mysqlpp_1_1SQLStream__coll__map" alt="Collaboration graph"></center>
<map name="mysqlpp_1_1SQLStream__coll__map">
<area href="classmysqlpp_1_1Connection.html" shape="rect" coords="187,188,347,212" alt="">
<area href="classmysqlpp_1_1OptionalExceptions.html" shape="rect" coords="6,97,219,121" alt="">
<area href="classmysqlpp_1_1DBDriver.html" shape="rect" coords="395,97,542,121" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classmysqlpp_1_1SQLStream-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 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_1SQLStream.html#d5c7fbaf7deb94157dcb71f1efe4596b">SQLStream</a> (<a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> *c, const char *pstr=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a new stream object attached to a connection.  <a href="#d5c7fbaf7deb94157dcb71f1efe4596b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#0e13aec37b6179e439bf2a9acec87151">SQLStream</a> (const <a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> &amp;s)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a new stream object as a copy of another.  <a href="#0e13aec37b6179e439bf2a9acec87151"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#b41f043f8d4c8918805eb21b3bd1f8ab">escape_string</a> (std::string *ps, const char *original=0, size_t length=0) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a SQL-escaped version of a character buffer.  <a href="#b41f043f8d4c8918805eb21b3bd1f8ab"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#382c8418c3e03b11b592d48ee7832f72">escape_string</a> (char *escaped, const char *original, size_t length) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a SQL-escaped version of the given character buffer.  <a href="#382c8418c3e03b11b592d48ee7832f72"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="48bd3485fca317bfef9b21405aca78d2"></a><!-- doxytag: member="mysqlpp::SQLStream::operator=" ref="48bd3485fca317bfef9b21405aca78d2" args="(const SQLStream &amp;rhs)" -->
<a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#48bd3485fca317bfef9b21405aca78d2">operator=</a> (const <a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> &amp;rhs)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assigns contents of another <a class="el" href="classmysqlpp_1_1SQLStream.html">SQLStream</a> to this one. <br></td></tr>
<tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="58377cc5c3925dd87be081d47e021d79"></a><!-- doxytag: member="mysqlpp::SQLStream::conn_" ref="58377cc5c3925dd87be081d47e021d79" args="" -->
<a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmysqlpp_1_1SQLStream.html#58377cc5c3925dd87be081d47e021d79">conn_</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="classmysqlpp_1_1Connection.html">Connection</a> to send queries through. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A class for building SQL-formatted strings. 
<p>
See the user manual for more details about these options. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="d5c7fbaf7deb94157dcb71f1efe4596b"></a><!-- doxytag: member="mysqlpp::SQLStream::SQLStream" ref="d5c7fbaf7deb94157dcb71f1efe4596b" args="(Connection *c, const char *pstr=0)" -->
<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> *&nbsp;</td>
          <td class="paramname"> <em>c</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>pstr</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a new stream object attached to a connection. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>connection used for escaping text </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pstr</em>&nbsp;</td><td>an optional initial string </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="0e13aec37b6179e439bf2a9acec87151"></a><!-- doxytag: member="mysqlpp::SQLStream::SQLStream" ref="0e13aec37b6179e439bf2a9acec87151" args="(const SQLStream &amp;s)" -->
<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> &amp;&nbsp;</td>
          <td class="paramname"> <em>s</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a new stream object as a copy of another. 
<p>
This is a traditional copy ctor. 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="382c8418c3e03b11b592d48ee7832f72"></a><!-- doxytag: member="mysqlpp::SQLStream::escape_string" ref="382c8418c3e03b11b592d48ee7832f72" args="(char *escaped, const char *original, size_t length) const " -->
<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 *&nbsp;</td>
          <td class="paramname"> <em>escaped</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>original</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>length</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return a SQL-escaped version of the given character buffer. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>escaped</em>&nbsp;</td><td>character buffer to hold escaped version; must point to at least (length * 2 + 1) bytes </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>original</em>&nbsp;</td><td>pointer to the character buffer to escape </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>number of characters to escape</td></tr>
  </table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>number</em>&nbsp;</td><td>of characters placed in escaped</td></tr>
  </table>
</dl>
<a class="el" href="classmysqlpp_1_1DBDriver.html">DBDriver</a> provides two versions of this method and <a class="el" href="classmysqlpp_1_1Query.html#dc7d259cbf78f1e418b7ad12751c5342">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#69881b0fab7f7d10c1d1adc7aacbbd6a">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">DBDriver</a> provides a static version of the function that doesn't use a database connection.<p>
<dl compact><dt><b>See also:</b></dt><dd>comments for <a class="el" href="classmysqlpp_1_1DBDriver.html#69881b0fab7f7d10c1d1adc7aacbbd6a">DBDriver::escape_string(char*, const char*, size_t)</a>, <a class="el" href="classmysqlpp_1_1DBDriver.html#2a404051fc2cc55b9e1f41cfe47190f3">DBDriver::escape_string_no_conn(char*, const char*, size_t)</a> for further details. </dd></dl>

</div>
</div><p>
<a class="anchor" name="b41f043f8d4c8918805eb21b3bd1f8ab"></a><!-- doxytag: member="mysqlpp::SQLStream::escape_string" ref="b41f043f8d4c8918805eb21b3bd1f8ab" args="(std::string *ps, const char *original=0, size_t length=0) const " -->
<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 *&nbsp;</td>
          <td class="paramname"> <em>ps</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>original</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>length</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return a SQL-escaped version of a character buffer. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ps</em>&nbsp;</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 valign="top"></td><td valign="top"><em>original</em>&nbsp;</td><td>if given, pointer to the character buffer to escape instead of contents of *ps </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>if both this and original are given, number of characters to escape instead of ps-&gt;length()</td></tr>
  </table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>number</em>&nbsp;</td><td>of characters placed in *ps</td></tr>
  </table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd>comments for escape_string(char*, const char*, size_t) and <a class="el" href="classmysqlpp_1_1DBDriver.html#64b30d25d02719ffc22f9b3ba92cdd89">DBDriver::escape_string(std::string*, const char *, size_t)</a> for further details. </dd></dl>

</div>
</div><p>
<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>sqlstream.cpp</ul>
<hr size="1"><address style="align: right;"><small>Generated on Thu Jun 3 11:59:12 2010 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>