Add no-deprecated to warnings due to dynamic exceptions.
[anna.git] / include / anna / dbms.mysql / OutputBind.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_dbms_mysql_OutputBind_hpp
10 #define anna_dbms_mysql_OutputBind_hpp
11
12 #include <anna/core/DataBlock.hpp>
13
14 #include <anna/dbms/OutputBind.hpp>
15 #include <anna/dbms/DatabaseException.hpp>
16
17 #include <anna/dbms.mysql/BaseBind.hpp>
18
19 namespace anna {
20
21 class DataBlock;
22
23 namespace dbms {
24
25 class Statement;
26
27 namespace mysql {
28
29 class OutputBind : public dbms::OutputBind, public BaseBind {
30 public:
31   OutputBind(const char* name, dbms::Data& data);
32   ~OutputBind();
33
34 private:
35   struct Blob {
36     DataBlock buffer;
37     st_mysql_stmt* stmt;
38     st_mysql_bind* binds;
39     int pos;
40
41     Blob();
42   };
43
44   Blob* a_blob;
45
46   void decodeLongBlob(dbms::Data&) const throw(RuntimeException, dbms::DatabaseException);
47   void decodeDate(dbms::Data&) throw();
48
49   static unsigned char asByte(const char hex)
50   throw() {
51     return (hex >= '0' && hex <= '9') ? (hex - '0') : ((hex - 'A') + 0x0a);
52   }
53
54   /* Funciones virtuales puras */
55   void decode() const throw(RuntimeException);
56   void prepare(anna::dbms::Statement*, anna::dbms::Connection*, const int pos) throw(RuntimeException);
57   void release(anna::dbms::Statement*) throw() {;}
58   void do_write(const dbms::LongBlock&) const throw(RuntimeException, dbms::DatabaseException);
59
60   friend class Statement;
61 };
62
63 }
64 }
65 }
66
67 #endif
68