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

pqxxobject::update_query Class Reference

Database UPDATE query class. More...

#include <update_query.h>

Inheritance diagram for pqxxobject::update_query:

pqxxobject::query List of all members.

Public Types

typedef std::pair< std::string,
std::string > 
field_value

Public Member Functions

 update_query ()
 The constructor.

 update_query (const std::string &table)
 The constructor.

 update_query (const update_query &rhs)
 The copy constructor.

virtual ~update_query ()
 The destructor.

template<typename T, template< typename > class F> void add (F< T > &field)
 Add a field to the query.

template<typename T, template< typename > class F> void where (F< T > &field)
 Add a WHERE clause to the query.

void where (const std::string &where_string)
 Add a WHERE clause to the query.

void remove (const field_base &field)
 Remove a field from the query.

std::string str ()
 Get the query as a string.


Private Attributes

std::string m_table_name
std::list< field_valuem_field_list
std::string m_where

Detailed Description

Database UPDATE query class.

Convenience class to generate a database UPDATE query string.

Definition at line 59 of file update_query.h.


Member Typedef Documentation

typedef std::pair<std::string, std::string> pqxxobject::update_query::field_value
 

Definition at line 77 of file update_query.h.


Constructor & Destructor Documentation

update_query::update_query  ) 
 

The constructor.

Definition at line 43 of file update_query.cc.

update_query::update_query const std::string &  table  )  [explicit]
 

The constructor.

Parameters:
table the name of the table to update into

Definition at line 51 of file update_query.cc.

update_query::update_query const update_query rhs  ) 
 

The copy constructor.

Definition at line 59 of file update_query.cc.

update_query::~update_query  )  [virtual]
 

The destructor.

Definition at line 67 of file update_query.cc.


Member Function Documentation

template<typename T, template< typename > class F>
void pqxxobject::update_query::add F< T > &  field  )  [inline]
 

Add a field to the query.

Parameters:
field the field to add.

Definition at line 84 of file update_query.h.

References pqxxobject::query_helper< T, F >::apply(), m_field_list, and remove().

void update_query::remove const field_base field  ) 
 

Remove a field from the query.

Parameters:
field the field to remove.

Definition at line 72 of file update_query.cc.

References pqxxobject::field_base::get_column_name(), and m_field_list.

Referenced by add().

std::string update_query::str  ) 
 

Get the query as a string.

Returns:
the query

Definition at line 85 of file update_query.cc.

References m_field_list, m_table_name, and m_where.

Referenced by pqxxobject::operator<<().

void pqxxobject::update_query::where const std::string &  where_string  )  [inline]
 

Add a WHERE clause to the query.

Parameters:
where_string the text of the WHERE clause.

Definition at line 111 of file update_query.h.

References m_where.

template<typename T, template< typename > class F>
void pqxxobject::update_query::where F< T > &  field  )  [inline]
 

Add a WHERE clause to the query.

Parameters:
field the field to add.

Definition at line 96 of file update_query.h.

References pqxxobject::query_helper< T, F >::apply(), and m_where.


Member Data Documentation

std::list<field_value> pqxxobject::update_query::m_field_list [private]
 

Definition at line 130 of file update_query.h.

Referenced by add(), remove(), and str().

std::string pqxxobject::update_query::m_table_name [private]
 

Definition at line 129 of file update_query.h.

Referenced by str().

std::string pqxxobject::update_query::m_where [private]
 

Definition at line 131 of file update_query.h.

Referenced by str(), and where().


The documentation for this class was generated from the following files:
Generated on Thu Apr 1 10:37:57 2004 for pqxx-object API Reference by doxygen 1.3.5