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 { libtabula::quote }
enum  quote_only_type0 { libtabula::quote_only }
enum  quote_double_only_type0 { libtabula::quote_double_only }
enum  escape_type0 { escape }
enum  do_nothing_type0 { libtabula::do_nothing }
enum  ignore_type0 { libtabula::ignore }

Functions

SQLQueryParms & libtabula::operator<< (escape_type2 p, SQLTypeAdapter &in)
 Inserts a SQLTypeAdapter into a stream, escaping special SQL characters.
ostream & libtabula::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 Libtabula 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.


Generated on 26 May 2014 for Libtabula by  doxygen 1.6.1