SQLValueBinder.h++

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002    commonc++ - A C++ Common Class Library
00003    Copyright (C) 2005-2012  Mark A Lindner
00004 
00005    This file is part of commonc++.
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public
00018    License along with this library; if not, write to the Free
00019    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020    ---------------------------------------------------------------------------
00021 */
00022 
00023 #ifndef __ccxx_SQLValueBinder_hxx
00024 #define __ccxx_SQLValueBinder_hxx
00025 
00026 #include <commonc++/Common.h++>
00027 #include <commonc++/OutOfBoundsException.h++>
00028 #include <commonc++/SQLException.h++>
00029 
00030 namespace ccxx {
00031 
00032 class SQLQuery;
00033 
00040 class COMMONCPPDB_API SQLValueBinder
00041 {
00042   public:
00043 
00046   SQLValueBinder(SQLQuery &query) throw();
00047 
00049   ~SQLValueBinder() throw();
00050 
00057   SQLValueBinder& operator<<(bool value)
00058     throw(SQLException, OutOfBoundsException);
00059 
00066   SQLValueBinder& operator<<(int value)
00067     throw(SQLException, OutOfBoundsException);
00068 
00075   SQLValueBinder& operator<<(const int64_t &value)
00076     throw(SQLException, OutOfBoundsException);
00077 
00084   SQLValueBinder& operator<<(const double &value)
00085     throw(SQLException, OutOfBoundsException);
00086 
00093   SQLValueBinder& operator<<(const String &value)
00094     throw(SQLException, OutOfBoundsException);
00095 
00102   SQLValueBinder& operator<<(const char *value)
00103     throw(SQLException, OutOfBoundsException);
00104 
00111   SQLValueBinder& operator<<(const Blob &value)
00112     throw(SQLException, OutOfBoundsException);
00113 
00120   SQLValueBinder& operator>>(bool &value)
00121     throw(SQLException, OutOfBoundsException);
00122 
00129   SQLValueBinder& operator>>(int &value)
00130     throw(SQLException, OutOfBoundsException);
00131 
00138   SQLValueBinder& operator>>(int64_t &value)
00139     throw(SQLException, OutOfBoundsException);
00140 
00148   SQLValueBinder& operator>>(double &value)
00149     throw(SQLException, OutOfBoundsException);
00150 
00157   SQLValueBinder& operator>>(String &value)
00158     throw(SQLException, OutOfBoundsException);
00159 
00166   SQLValueBinder& operator>>(Blob &value)
00167     throw(SQLException, OutOfBoundsException);
00168 
00172   void reset() throw();
00173 
00174   private:
00175 
00176   void checkInputIndex() throw(OutOfBoundsException);
00177   void checkOutputIndex() throw(OutOfBoundsException);
00178 
00179   SQLQuery &_query;
00180   uint_t _index;
00181 
00182   CCXX_COPY_DECLS(SQLValueBinder);
00183 };
00184 
00185 } // namespace ccxx
00186 
00187 #endif // __ccxx_SQLValueBinder_hxx
00188 
00189 /* end of header file */
Generated on Sat Nov 26 16:49:07 2011 for libcommonc++ by  doxygen 1.6.3