00001 #include "StDbFastSqlWriter.h"
00002 #include "StDbTable.h"
00003
00004 void
00005 StDbFastSqlWriter::ioTable(StDbTable* table){
00006
00007 table->setRowNumber();
00008 int nrows=table->GetNRows();
00009 for(int k=0;k<nrows;k++){
00010 if(k>0)*os<<"),(";
00011 *os<<table->getBeginTime();
00012 table->dbStreamer((typeAcceptor*)this,false);
00013 }
00014
00015 }
00016
00017 void
00018 StDbFastSqlWriter::pass(char* name, unsigned char*& i, int& len){
00019 *os<<",'"<<(int)i[0];
00020 for(int j=1;j<len;j++)*os<<","<<(int)i[j];
00021 *os<<"'";
00022 }
00023
00024 void
00025 StDbFastSqlWriter::pass(char* name, short*& i, int& len){
00026 *os<<",'"<<i[0];
00027 for(int j=1;j<len;j++)*os<<","<<i[j];
00028 *os<<"'";
00029 }
00030
00031 void
00032 StDbFastSqlWriter::pass(char* name, int*& i, int& len){
00033 *os<<",'"<<i[0];
00034 for(int j=1;j<len;j++)*os<<","<<i[j];
00035 *os<<"'";
00036 }
00037
00038 void
00039 StDbFastSqlWriter::pass(char* name, long*& i, int& len){
00040 *os<<",'"<<i[0];
00041 for(int j=1;j<len;j++)*os<<","<<i[j];
00042 *os<<"'";
00043 }
00044
00045
00046 void
00047 StDbFastSqlWriter::pass(char* name, unsigned short*& i, int& len){
00048 *os<<",'"<<i[0];
00049 for(int j=1;j<len;j++)*os<<","<<i[j];
00050 *os<<"'";
00051 }
00052
00053 void
00054 StDbFastSqlWriter::pass(char* name, unsigned int*& i, int& len){
00055 *os<<",'"<<i[0];
00056 for(int j=1;j<len;j++)*os<<","<<i[j];
00057 *os<<"'";
00058 }
00059
00060 void
00061 StDbFastSqlWriter::pass(char* name, unsigned long*& i, int& len){
00062 *os<<",'"<<i[0];
00063 for(int j=1;j<len;j++)*os<<","<<i[j];
00064 *os<<"'";
00065 }
00066
00067 void
00068 StDbFastSqlWriter::pass(char* name, long long*& i, int& len){
00069 *os<<",'"<<i[0];
00070 for(int j=1;j<len;j++)*os<<","<<i[j];
00071 *os<<"'";
00072 }
00073
00074 void
00075 StDbFastSqlWriter::pass(char* name, float*& i, int& len){
00076 *os<<",'"<<i[0];
00077 for(int j=1;j<len;j++)*os<<","<<i[j];
00078 *os<<"'";
00079 }
00080
00081 void
00082 StDbFastSqlWriter::pass(char* name, double*& i, int& len){
00083 *os<<",'"<<i[0];
00084 for(int j=1;j<len;j++)*os<<","<<i[j];
00085 *os<<"'";
00086 }
00087
00088