MySQL++ Reference Manual

- Main Page
- Classes
- Files

- File List
- File Members

# manip.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004
    00005
    00006
    00007
    00008
    00009
    00010
    00011
    00012
    00013
    00014
    00015
    00016
    00017 /***********************************************************************
    00018  Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
    00019  (c) 2004-2007 by Educational Technology Resources, Inc.  Others may
    00020  also hold copyrights on code in this file.  See the CREDITS.txt file
    00021  in the top directory of the distribution for details.
    00022
    00023  This file is part of MySQL++.
    00024
    00025  MySQL++ is free software; you can redistribute it and/or modify it
    00026  under the terms of the GNU Lesser General Public License as published
    00027  by the Free Software Foundation; either version 2.1 of the License, or
    00028  (at your option) any later version.
    00029
    00030  MySQL++ is distributed in the hope that it will be useful, but WITHOUT
    00031  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    00032  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00033  License for more details.
    00034
    00035  You should have received a copy of the GNU Lesser General Public
    00036  License along with MySQL++; if not, write to the Free Software
    00037  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
    00038  USA
    00039 ***********************************************************************/
    00040
    00041 #ifndef MYSQLPP_MANIP_H
    00042 #define MYSQLPP_MANIP_H
    00043
    00044 #include "common.h"
    00045
    00046 #include "myset.h"
    00047 #include "stadapter.h"
    00048
    00049 #include <iostream>
    00050
    00051 namespace mysqlpp {
    00052
    00053 class SQLQueryParms;
    00054
    00055
    00069
    00070 enum quote_type0
    00071 {
    00072         quote
    00073 };
    00074
    00075
    00076 #if !defined(DOXYGEN_IGNORE)
    00077 // Doxygen will not generate documentation for this section.
    00078
    00079 struct quote_type1
    00080 {
    00081         std::ostream * ostr;
    00082         quote_type1(std::ostream * o) :
    00083         ostr(o)
    00084         {
    00085         }
    00086 };
    00087
    00088
    00089 inline quote_type1
    00090 operator <<(std::ostream& o, quote_type0 /* esc */)
    00091 {
    00092         return quote_type1(&o);
    00093 }
    00094
    00095
    00096 struct quote_type2
    00097 {
    00098         SQLQueryParms *qparms;
    00099         quote_type2(SQLQueryParms* p) :
    00100         qparms(p)
    00101         {
    00102         }
    00103 };
    00104
    00105
    00106 inline quote_type2
    00107 operator <<(SQLQueryParms& p, quote_type0 /* esc */)
    00108 {
    00109         return quote_type2(&p);
    00110 }
    00111
    00112
    00115
    00116 MYSQLPP_EXPORT SQLQueryParms& operator <<(quote_type2 p,
    00117                 SQLTypeAdapter& in);
    00118
    00119
    00122
    00123 MYSQLPP_EXPORT std::ostream& operator <<(quote_type1 o,
    00124                 const SQLTypeAdapter& in);
    00125
    00126
    00133
    00134 MYSQLPP_EXPORT std::ostream& operator <<(std::ostream& o,
    00135                 const SQLTypeAdapter& in);
    00136
    00137
    00138 template <class ST>
    00139 inline std::ostream&
    00140 operator <<(quote_type1 o, const Set<ST>& in)
    00141 {
    00142         return *o.ostr << '\'' << in << '\'';
    00143 }
    00144
    00145 #endif // !defined(DOXYGEN_IGNORE)
    00146
    00147
    00155
    00156 enum quote_only_type0
    00157 {
    00158         quote_only
    00159 };
    00160
    00161
    00162 #if !defined(DOXYGEN_IGNORE)
    00163 // Doxygen will not generate documentation for this section.
    00164
    00165 struct quote_only_type1
    00166 {
    00167         std::ostream* ostr;
    00168         quote_only_type1(std::ostream* o) :
    00169         ostr(o)
    00170         {
    00171         }
    00172 };
    00173
    00174
    00175 inline quote_only_type1
    00176 operator <<(std::ostream& o, quote_only_type0 /* esc */)
    00177 {
    00178         return quote_only_type1(&o);
    00179 }
    00180
    00181
    00182 struct quote_only_type2
    00183 {
    00184         SQLQueryParms* qparms;
    00185         quote_only_type2(SQLQueryParms* p) :
    00186         qparms(p)
    00187         {
    00188         }
    00189 };
    00190
    00191
    00192 inline quote_only_type2
    00193 operator <<(SQLQueryParms& p, quote_only_type0 /* esc */)
    00194 {
    00195         return quote_only_type2(&p);
    00196 }
    00197
    00198
    00205
    00206 MYSQLPP_EXPORT SQLQueryParms& operator <<(quote_only_type2 p,
    00207                 SQLTypeAdapter& in);
    00208
    00209
    00210 std::ostream& operator <<(quote_only_type1 o, const SQLTypeAdapter& in);
    00211
    00212
    00213 template <class ST>
    00214 inline std::ostream&
    00215 operator <<(quote_only_type1 o, const Set<ST>& in)
    00216 {
    00217         return *o.ostr << '\'' << in << '\'';
    00218 }
    00219
    00220 #endif // !defined(DOXYGEN_IGNORE)
    00221
    00222
    00235
    00236 enum quote_double_only_type0
    00237 {
    00238         quote_double_only
    00239 };
    00240
    00241
    00242 #if !defined(DOXYGEN_IGNORE)
    00243 // Doxygen will not generate documentation for this section.
    00244
    00245 struct quote_double_only_type1
    00246 {
    00247         std::ostream* ostr;
    00248         quote_double_only_type1(std::ostream* o) :
    00249         ostr(o)
    00250         {
    00251         }
    00252 };
    00253
    00254
    00255 inline quote_double_only_type1
    00256 operator <<(std::ostream& o, quote_double_only_type0 /* esc */)
    00257 {
    00258         return quote_double_only_type1(&o);
    00259 }
    00260
    00261
    00262 struct quote_double_only_type2
    00263 {
    00264         SQLQueryParms *qparms;
    00265         quote_double_only_type2(SQLQueryParms* p) :
    00266         qparms(p)
    00267         {
    00268         }
    00269 };
    00270
    00271
    00272 inline quote_double_only_type2
    00273 operator <<(SQLQueryParms& p, quote_double_only_type0 /* esc */)
    00274 {
    00275         return quote_double_only_type2(&p);
    00276 }
    00277
    00278
    00285
    00286 MYSQLPP_EXPORT SQLQueryParms&
    00287 operator <<(quote_double_only_type2 p, SQLTypeAdapter& in);
    00288
    00289
    00290 std::ostream&
    00291 operator <<(quote_double_only_type1 o, const SQLTypeAdapter& in);
    00292
    00293
    00294 template <class ST>
    00295 inline std::ostream&
    00296 operator <<(quote_double_only_type1 o, const Set<ST>& in)
    00297 {
    00298         return *o.ostr << '"' << in << '"';
    00299 }
    00300
    00301 #endif // !defined(DOXYGEN_IGNORE)
    00302
    00303
    00314
    00315 enum escape_type0 { escape };
    00316
    00317
    00318 #if !defined(DOXYGEN_IGNORE)
    00319 // Doxygen will not generate documentation for this section.
    00320
    00321 struct escape_type1
    00322 {
    00323         std::ostream* ostr;
    00324         escape_type1(std::ostream* o) :
    00325         ostr(o)
    00326         {
    00327         }
    00328 };
    00329
    00330
    00331 inline escape_type1
    00332 operator <<(std::ostream& o, escape_type0 /* esc */)
    00333 {
    00334         return escape_type1(&o);
    00335 }
    00336
    00337
    00338 struct escape_type2
    00339 {
    00340         SQLQueryParms *qparms;
    00341         escape_type2(SQLQueryParms* p) :
    00342         qparms(p)
    00343         {
    00344         }
    00345 };
    00346
    00347
    00348 inline escape_type2
    00349 operator <<(SQLQueryParms& p, escape_type0 /* esc */)
    00350 {
    00351         return escape_type2(&p);
    00352 }
    00353
    00354 #endif // !defined(DOXYGEN_IGNORE)
    00355
    00356
    00363
    00364 MYSQLPP_EXPORT SQLQueryParms& operator <<(escape_type2 p,
    00365                 SQLTypeAdapter& in);
    00366
    00367
    00370
    00371 MYSQLPP_EXPORT std::ostream& operator <<(escape_type1 o,
    00372                 const SQLTypeAdapter& in);
    00373
    00374
    00385
    00386 enum do_nothing_type0
    00387 {
    00388         do_nothing
    00389 };
    00390
    00391
    00392 #if !defined(DOXYGEN_IGNORE)
    00393 // Doxygen will not generate documentation for this section.
    00394
    00395 struct do_nothing_type1
    00396 {
    00397         std::ostream* ostr;
    00398         do_nothing_type1(std::ostream* o) :
    00399         ostr(o)
    00400         {
    00401         }
    00402 };
    00403
    00404
    00405 inline do_nothing_type1
    00406 operator <<(std::ostream& o, do_nothing_type0 /* esc */)
    00407 {
    00408         return do_nothing_type1(&o);
    00409 }
    00410
    00411
    00412 MYSQLPP_EXPORT std::ostream&
    00413 operator <<(do_nothing_type1 o, const SQLTypeAdapter& in);
    00414
    00415
    00416 struct do_nothing_type2
    00417 {
    00418         SQLQueryParms *qparms;
    00419         do_nothing_type2(SQLQueryParms* p) :
    00420         qparms(p)
    00421         {
    00422         }
    00423 };
    00424
    00425
    00426 inline do_nothing_type2
    00427 operator <<(SQLQueryParms& p, do_nothing_type0 /* esc */)
    00428 {
    00429         return do_nothing_type2(&p);
    00430 }
    00431
    00432
    00435
    00436 MYSQLPP_EXPORT SQLQueryParms& operator <<(do_nothing_type2 p,
    00437                 SQLTypeAdapter& in);
    00438
    00439 #endif // !defined(DOXYGEN_IGNORE)
    00440
    00441
    00451
    00452 enum ignore_type0
    00453 {
    00454         ignore
    00455 };
    00456
    00457
    00458 #if !defined(DOXYGEN_IGNORE)
    00459 // Doxygen will not generate documentation for this section.
    00460
    00461 struct ignore_type2
    00462 {
    00463         SQLQueryParms* qparms;
    00464         ignore_type2(SQLQueryParms* p) :
    00465         qparms(p)
    00466         {
    00467         }
    00468 };
    00469
    00470
    00471 inline ignore_type2
    00472 operator <<(SQLQueryParms& p, ignore_type0 /* esc */)
    00473 {
    00474         return ignore_type2(&p);
    00475 }
    00476
    00477
    00480
    00481 MYSQLPP_EXPORT SQLQueryParms& operator <<(ignore_type2 p,
    00482                 SQLTypeAdapter& in);
    00483
    00484 #endif // !defined(DOXYGEN_IGNORE)
    00485
    00486 } // end namespace mysqlpp
    00487
    00488 #endif