field_types.h
Go to the documentation of this file.
/***********************************************************************
Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by
MySQL AB, and (c) 2004-2007 by Educational Technology Resources, Inc.
Others may also hold copyrights on code in this file. See the CREDITS
file in the top directory of the distribution for details.
This file is part of MySQL++.
MySQL++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
MySQL++ is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with MySQL++; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
***********************************************************************/
#ifndef MYSQLPP_FIELD_TYPES_H
#define MYSQLPP_FIELD_TYPES_H
#include "type_info.h"
#include <vector>
namespace mysqlpp {
#if !defined(DOXYGEN_IGNORE)
// Make Doxygen ignore this
class MYSQLPP_EXPORT ResultBase;
#endif
class FieldTypes : public std::vector<mysql_type_info>
{
public:
FieldTypes() { }
FieldTypes(const ResultBase* res)
{
init(res);
}
FieldTypes(int i) :
std::vector<mysql_type_info>(i)
{
}
FieldTypes& operator =(const ResultBase* res)
{
init(res);
return *this;
}
FieldTypes& operator =(int i)
{
insert(begin(), i, mysql_type_info());
return *this;
}
private:
void init(const ResultBase* res);
};
} // end namespace mysqlpp
#endif
mysqlpp::FieldTypes::FieldTypes
FieldTypes(const ResultBase *res)
Create list of field types from a result set.
Definition: field_types.h:50
mysqlpp::mysql_type_info
SQL field type information.
Definition: type_info.h:148
mysqlpp::FieldTypes::operator=
FieldTypes & operator=(const ResultBase *res)
Initialize field list based on a result set.
Definition: field_types.h:62
type_info.h
Declares classes that provide an interface between the SQL and C++ type systems.
mysqlpp::ResultBase
Base class for StoreQueryResult and UseQueryResult.
Definition: result.h:110
mysqlpp::FieldTypes
A vector of SQL field types.
Definition: field_types.h:43
mysqlpp::FieldTypes::FieldTypes
FieldTypes()
Default constructor.
Definition: field_types.h:47
mysqlpp::FieldTypes::FieldTypes
FieldTypes(int i)
Create fixed-size list of uninitialized field types.
Definition: field_types.h:56