00001 #ifndef MYSQLPP_FIELD_TYPES_H
00002 #define MYSQLPP_FIELD_TYPES_H
00003
00006
00007 #include "type_info.h"
00008
00009 #include <vector>
00010
00011 namespace mysqlpp {
00012
00013 class ResUse;
00014
00016 class FieldTypes : public std::vector<mysql_type_info> {
00017 private:
00018 void init (const ResUse *res);
00019 public:
00020 FieldTypes () {}
00021 FieldTypes (const ResUse *res) {init(res);}
00022 FieldTypes (int i) : std::vector<mysql_type_info>(i) {}
00023
00025 FieldTypes& operator =(const ResUse *res) {init(res); return *this;}
00026
00033 FieldTypes& operator =(int i)
00034 {
00035 insert(begin(), i, mysql_type_info());
00036 return *this;
00037 }
00038
00040 mysql_type_info& operator [](int i)
00041 {
00042 return std::vector<mysql_type_info>::operator[](i);
00043 }
00044 const mysql_type_info& operator [](int i) const
00045 {
00046 return std::vector<mysql_type_info>::operator[](i);
00047 }
00048 };
00049
00050 }
00051
00052 #endif
00053