X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fdbms.mysql%2FOutputBind.hpp;fp=include%2Fanna%2Fdbms.mysql%2FOutputBind.hpp;h=72e9929b62f1cee0c2d09d3c5809bafc25b6cf16;hb=78be86969d2f26a9084b0c4af6ce43d5fa4ed3fd;hp=0000000000000000000000000000000000000000;hpb=a3b95648bd76140ef55e0b5941d423eee6c3856f;p=anna.git diff --git a/include/anna/dbms.mysql/OutputBind.hpp b/include/anna/dbms.mysql/OutputBind.hpp new file mode 100644 index 0000000..72e9929 --- /dev/null +++ b/include/anna/dbms.mysql/OutputBind.hpp @@ -0,0 +1,68 @@ +// ANNA - Anna is Not Nothingness Anymore // +// // +// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo // +// // +// See project site at http://redmine.teslayout.com/projects/anna-suite // +// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE // + + +#ifndef anna_dbms_mysql_OutputBind_hpp +#define anna_dbms_mysql_OutputBind_hpp + +#include + +#include +#include + +#include + +namespace anna { + +class DataBlock; + +namespace dbms { + +class Statement; + +namespace mysql { + +class OutputBind : public dbms::OutputBind, public BaseBind { +public: + OutputBind(const char* name, dbms::Data& data); + ~OutputBind(); + +private: + struct Blob { + DataBlock buffer; + st_mysql_stmt* stmt; + st_mysql_bind* binds; + int pos; + + Blob(); + }; + + Blob* a_blob; + + void decodeLongBlob(dbms::Data&) const throw(RuntimeException, dbms::DatabaseException); + void decodeDate(dbms::Data&) throw(); + + static unsigned char asByte(const char hex) + throw() { + return (hex >= '0' && hex <= '9') ? (hex - '0') : ((hex - 'A') + 0x0a); + } + + /* Funciones virtuales puras */ + void decode() const throw(RuntimeException); + void prepare(anna::dbms::Statement*, anna::dbms::Connection*, const int pos) throw(RuntimeException); + void release(anna::dbms::Statement*) throw() {;} + void do_write(const dbms::LongBlock&) const throw(RuntimeException, dbms::DatabaseException); + + friend class Statement; +}; + +} +} +} + +#endif +