// InsertQuery.cxx #include "dataset_sql/InsertQuery.h" #include "dataset_sql/SqlResult.h" #include #include #include using std::string; using std::endl; using std::ostream; using dset::InsertQuery; using dset::SqlResult; typedef unsigned long Index; typedef SqlResult::Row Row; //********************************************************************** // Public members. //********************************************************************** // Constructor. InsertQuery::InsertQuery(Row row){ m_row = row; m_validity = true; } //********************************************************************** // Destructor. InsertQuery::~InsertQuery() { } //********************************************************************** // Validity. bool InsertQuery::is_valid() const { return m_validity; } //********************************************************************** // Set the curent query. InsertQuery& InsertQuery::set(Row row){ m_row = row; return *this; } //********************************************************************** // Return the Row in the curent query. Row InsertQuery::get_row() const{ return m_row; } //********************************************************************** // Output stream. ostream& InsertQuery::ostr(ostream &str) const { for( Row::const_iterator it = m_row.begin(); it != m_row.end(); ++it ) { str << it->first << " - " << it->second << endl; } return str; } //********************************************************************** // Free functions. //********************************************************************** // Output stream. ostream& operator << (ostream& lhs, const InsertQuery& rhs) { return rhs.ostr(lhs); } //**********************************************************************