Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

compare.h File Reference

#include "row.h"
#include <cstring>
#include <functional>

Include dependency graph for compare.h:

Include dependency graph

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

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  mysqlpp

Classes

class  mysqlpp::MysqlCmp< BinaryPred, CmpType >
 Template for making function objects that can compare something against a Row element. More...
class  mysqlpp::MysqlCmpCStr< BinaryPred >
 const char* specialization of MysqlCmp More...
struct  mysqlpp::cstr_equal_to
 Function object that returns true if one const char* is equal to another. More...
struct  mysqlpp::cstr_not_equal_to
 Function object that returns true if one const char* is not equal to another. More...
struct  mysqlpp::cstr_less
 Function object that returns true if one const char* is lexically "less than" another. More...
struct  mysqlpp::cstr_less_equal
 Function object that returns true if one const char* is lexically "less than or equal to" another. More...
struct  mysqlpp::cstr_greater
 Function object that returns true if one const char* is lexically "greater than" another. More...
struct  mysqlpp::cstr_greater_equal
 Function object that returns true if one const char* is lexically "greater than or equal to" another. More...

Typedefs

typedef std::binary_function<
const char *, const char *,
bool > 
bin_char_pred
 Base class for the other predicate types defined in compare.h.

Functions

template<class BinaryPred, class CmpType>
MysqlCmp< BinaryPred, CmpType > mysql_cmp (uint i, const BinaryPred &func, const CmpType &cmp2)
 Template for function objects that compare any two objects, as long as they can be converted to SQLString.
template<class BinaryPred>
MysqlCmpCStr< BinaryPred > mysql_cmp_cstr (uint i, const BinaryPred &func, const char *cmp2)
 Template for function objects that compare any two things that can be converted to const char*.


Detailed Description

Declares several function objects and templates for creating function objects for comparing various things. These are useful when using STL algorithms like std::find_if() on containers of data retreived from a database with MySQL++.

Function Documentation

template<class BinaryPred, class CmpType>
MysqlCmp<BinaryPred, CmpType> mysql_cmp uint  i,
const BinaryPred &  func,
const CmpType &  cmp2
 

Template for function objects that compare any two objects, as long as they can be converted to SQLString.

This is a more generic form of mysql_cmp_cstr(), and is therefore less efficient. Use this form only when necessary.

Parameters:
i field index number
func one of the functors in compare.h, or any compatible functor
cmp2 what to compare to

template<class BinaryPred>
MysqlCmpCStr<BinaryPred> mysql_cmp_cstr uint  i,
const BinaryPred &  func,
const char *  cmp2
 

Template for function objects that compare any two things that can be converted to const char*.

Parameters:
i field index number
func one of cstr_equal_to, cstr_not_equal_to, cstr_less, cstr_less_equal, cstr_less_equal, or cstr_less_equal.
cmp2 what to compare to
See also:
mysql_cmp()


Generated on Tue Aug 16 12:53:44 2005 for MySQL++ by  doxygen 1.3.9.1