manip.h File Reference

Declares std::ostream manipulators useful with SQL syntax. More...

#include "common.h"
#include "datetime.h"
#include "myset.h"
#include "sql_string.h"
#include <mysql.h>
#include <iostream>

Include dependency graph for manip.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mysqlpp

Enumerations

enum  mysqlpp::quote_type0 { mysqlpp::quote }
enum  mysqlpp::quote_only_type0 { mysqlpp::quote_only }
enum  mysqlpp::quote_double_only_type0 { mysqlpp::quote_double_only }
enum  mysqlpp::escape_type0 { escape }
enum  mysqlpp::do_nothing_type0 { mysqlpp::do_nothing }
enum  mysqlpp::ignore_type0 { mysqlpp::ignore }

Functions

SQLQueryParms & mysqlpp::operator<< (escape_type2 p, SQLString &in)
 Inserts a SQLString into a stream, escaping special SQL characters.
template<class T>
std::ostream & mysqlpp::operator<< (escape_type1 o, const T &in)
 Inserts any type T into a stream that has an operator<< defined for it.
template<>
std::ostream & mysqlpp::operator<< (escape_type1 o, const std::string &in)
 Inserts a C++ string into a stream, escaping special SQL characters.
template<>
ostream & mysqlpp::operator<< (escape_type1 o, const char *const &in)
 Inserts a C string into a stream, escaping special SQL characters.
template<>
std::ostream & mysqlpp::operator<< (escape_type1 o, const ColData_Tmpl< std::string > &in)
 Inserts a ColData into a stream, escaping special SQL characters.
template<>
std::ostream & mysqlpp::operator<< (escape_type1 o, const ColData_Tmpl< const_string > &in)
 Inserts a ColData with const string into a stream, escaping special SQL characters.
template<>
std::ostream & mysqlpp::operator<< (escape_type1 o, char *const &in)
 Inserts a C string into a stream, escaping special SQL characters.

Variables

bool mysqlpp::dont_quote_auto
 Set to true if you want to suppress automatic quoting.


Detailed Description

Declares std::ostream manipulators useful with SQL syntax.

These manipulators let you automatically quote elements or escape characters that are special in SQL when inserting them into an std::ostream. Since mysqlpp::Query is an ostream, these manipulators make it easier to build syntactically-correct SQL queries.

This file also includes operator<< definitions for ColData_Tmpl, one of the MySQL++ string-like classes. When inserting such items into a stream, they are automatically quoted and escaped as necessary unless the global variable dont_quote_auto is set to true. These operators are smart enough to turn this behavior off when the stream is cout or cerr, however, since quoting and escaping are surely not required in that instance.


Generated on Wed Feb 28 06:57:24 2007 for MySQL++ by  doxygen 1.5.1-3