#pragma once namespace scdriver { /************************************** * * class: C B u l k I m p o r t * ************************************** * * Functional description * * Export table data to a file located * on clients machine **************************************/ class __declspec( dllexport ) CBulkImport { public: CBulkImport(void); ~CBulkImport(void); /************************************** * * function: I m p o r t * ************************************** * * Functional description * * export table's data to file **************************************/ void Import(CConnection *conn, const char *table, const char *format); /************************************** * * function: O n R e a d * ************************************** * * Functional description * * callback read data to import **************************************/ virtual void OnRead(void *data, int &size); private: CConnection *m_conn; }; /************************************** * * class: C B u l k I m p o r t F i l e * ************************************** * * Functional description * * Import data from file to the table **************************************/ class __declspec( dllexport ) CBulkImportFile: public CBulkImport { public: int get_class_size(); CBulkImportFile(void); ~CBulkImportFile(void); /************************************** * * function: I m p o r t * ************************************** * * Functional description * * import table's data from file **************************************/ void Import(CConnection *conn, const char *table, const char *filename, const char *format, BULK_TRANSFER_CALLBACK *callback = 0); /************************************** * * function: O n R e a d * ************************************** * * Functional description * * save output **************************************/ virtual void OnRead(void *data,int &size); private: unsigned long m_err; // write to file error code HANDLE m_hfile; unsigned long m_total;// total number of bytes transferred to server BULK_TRANSFER_CALLBACK *m_transfer; }; }