MySQL++ Reference Manual

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Enumerations | Functions
manip.h File Reference

Declares the Query stream manipulators and operators. More...

`#include "common.h"`
`#include "myset.h"`
`#include "stadapter.h"`
`#include <iostream>`

Go to the source code of this file.

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

## Functions
SQLQueryParms & | mysqlpp::operator<< (escape_type2 p, SQLTypeAdapter &in)
| Inserts a SQLTypeAdapter into a stream, escaping special SQL characters. More...
ostream & | mysqlpp::operator<< (escape_type1 o, const SQLTypeAdapter &in)
| Inserts anything that can be converted to SQLTypeAdapter into a stream, escaping special SQL characters as needed.

## Detailed Description

Declares the Query stream manipulators and operators.

These manipulators let you automatically quote elements or escape characters that are special in SQL when inserting them into a Query stream. They make it easier to build syntactically-correct SQL queries.

This file also includes special `operator<<` definitions for a few key MySQL++ data types, since we know when to do automatic quoting and escaping for these types. This only works with Query streams, not regular std::ostreams, since we're only concerned with making correct SQL, not with presentation matters.

test/test_manip.cpp exercises the mechanisms defined here.