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

# sql_string.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004
    00005
    00006
    00007
    00008
    00009
    00010 /***********************************************************************
    00011  Copyright (c) 1998 by Kevin Atkinson, (c) 1999, 2000 and 2001 by
    00012  MySQL AB, and (c) 2004, 2005 by Educational Technology Resources, Inc.
    00013  Others may also hold copyrights on code in this file.  See the CREDITS
    00014  file in the top directory of the distribution for details.
    00015
    00016  This file is part of MySQL++.
    00017
    00018  MySQL++ is free software; you can redistribute it and/or modify it
    00019  under the terms of the GNU Lesser General Public License as published
    00020  by the Free Software Foundation; either version 2.1 of the License, or
    00021  (at your option) any later version.
    00022
    00023  MySQL++ is distributed in the hope that it will be useful, but WITHOUT
    00024  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    00025  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00026  License for more details.
    00027
    00028  You should have received a copy of the GNU Lesser General Public
    00029  License along with MySQL++; if not, write to the Free Software
    00030  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
    00031  USA
    00032 ***********************************************************************/
    00033
    00034 #ifndef MYSQLPP_SQL_STRING_H
    00035 #define MYSQLPP_SQL_STRING_H
    00036
    00037 #include "common.h"
    00038 #include "null.h"
    00039
    00040 #include <stdio.h>
    00041 #include <string>
    00042
    00043 namespace mysqlpp {
    00044
    00047
    00048 class MYSQLPP_EXPORT SQLString : public std::string {
    00049 public:
    00052         bool is_string;
    00053
    00056         bool dont_escape;
    00057
    00068         bool processed;
    00069
    00071         SQLString();
    00072
    00074         SQLString(const std::string& str);
    00075
    00077         SQLString(const char* str);
    00078
    00081         SQLString(const char* str, size_t len);
    00082
    00084         SQLString(char i);
    00085
    00088         SQLString(unsigned char i);
    00089
    00092         SQLString(short int i);
    00093
    00096         SQLString(unsigned short int i);
    00097
    00099         SQLString(int i);
    00100
    00103         SQLString(unsigned int i);
    00104
    00107         SQLString(longlong i);
    00108
    00111         SQLString(ulonglong i);
    00112
    00115         SQLString(float i);
    00116
    00119         SQLString(double i);
    00120
    00122         SQLString(const null_type& i);
    00123
    00125         SQLString& operator =(const char* str)
    00126         {
    00127                 std::string::operator =(str);
    00128                 processed = false;
    00129                 return *this;
    00130         }
    00131
    00133         SQLString& operator =(const std::string& str)
    00134         {
    00135                 std::string::operator =(str);
    00136                 processed = false;
    00137                 return *this;
    00138         }
    00139 };
    00140
    00141 } // end namespace mysqlpp
    00142
    00143 #endif