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

# sql_types.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004 /***********************************************************************
    00005  Copyright (c) 2006 by Educational Technology Resources, Inc.  Others
    00006  may also hold copyrights on code in this file.  See the CREDITS file in
    00007  the top directory of the distribution for details.
    00008
    00009  This file is part of MySQL++.
    00010
    00011  MySQL++ is free software; you can redistribute it and/or modify it
    00012  under the terms of the GNU Lesser General Public License as published
    00013  by the Free Software Foundation; either version 2.1 of the License, or
    00014  (at your option) any later version.
    00015
    00016  MySQL++ is distributed in the hope that it will be useful, but WITHOUT
    00017  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    00018  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00019  License for more details.
    00020
    00021  You should have received a copy of the GNU Lesser General Public
    00022  License along with MySQL++; if not, write to the Free Software
    00023  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
    00024  USA
    00025 ***********************************************************************/
    00026
    00027 #if !defined(MYSQLPP_SQL_TYPES_H)
    00028 #define MYSQLPP_SQL_TYPES_H
    00029
    00030 #include "common.h"
    00031
    00032 #include <string>
    00033
    00034 namespace mysqlpp {
    00035
    00036 #if !defined(DOXYGEN_IGNORE)
    00037 // Doxygen will not generate documentation for this section.
    00038
    00039 // Nearest C++ equivalents of MySQL data types.  These are only the "NOT
    00040 // NULL" variants.  Wrap these types in MySQL++'s Null<> template to get
    00041 // NULL-able types.
    00042 typedef signed char             sql_tinyint;
    00043 typedef unsigned char   sql_tinyint_unsigned;
    00044 typedef short                   sql_smallint;
    00045 typedef unsigned short  sql_smallint_unsigned;
    00046 typedef int                             sql_int;
    00047 typedef unsigned int    sql_int_unsigned;
    00048 typedef int                             sql_mediumint;
    00049 typedef unsigned int    sql_mediumint_unsigned;
    00050 typedef longlong                sql_bigint;
    00051 typedef ulonglong               sql_bigint_unsigned;
    00052
    00053 typedef float                   sql_float;
    00054 typedef double                  sql_double;
    00055 typedef double                  sql_decimal;
    00056
    00057 typedef std::string             sql_enum;
    00058
    00059 typedef ColData                 sql_blob;
    00060 typedef ColData                 sql_tinyblob;
    00061 typedef ColData                 sql_mediumblob;
    00062 typedef ColData                 sql_longblob;
    00063
    00064 typedef std::string             sql_char;
    00065 typedef std::string             sql_varchar;
    00066
    00067 #ifdef MYSQLPP_DATETIME_H
    00068     // MySQL++ date and time types are defined, so make aliases for
    00069     // them matching the style of the above types.
    00070     typedef Date                sql_date;
    00071     typedef Time                sql_time;
    00072     typedef Time                sql_timestamp;
    00073     typedef DateTime    sql_datetime;
    00074 #endif
    00075 #ifdef MYSQLPP_MYSET_H
    00076     // Ditto for MySQL++'s SQL set type
    00077     typedef Set<>               sql_set;
    00078 #endif
    00079
    00080 #endif // !defined(DOXYGEN_IGNORE)
    00081
    00082 } // end namespace mysqlpp
    00083
    00084 #endif // !defined(MYSQLPP_SQL_TYPES_H)
    00085