#pragma once namespace scdriver { /************************************** * * class: C B u l k E x p o r t * ************************************** * * Functional description * * Export table data to a file located * on clients machine **************************************/ class __declspec( dllexport ) CBulkExport { public: CBulkExport(void); ~CBulkExport(void); /************************************** * * function: E x p o r t * ************************************** * * Functional description * * export table's data to file **************************************/ void Export(CConnection *conn, const char *table, const char *format); /************************************** * * function: O n S a v e * ************************************** * * Functional description * * save output **************************************/ virtual void OnSave(const void *data, const int &size); /************************************** * * function: S a v e * ************************************** * * Functional description * * save output **************************************/ void Save(); private: byte m_data[PAGE_SIZE]; CConnection *m_conn; }; /************************************** * * class: C B u l k E x p o r t F i l e * ************************************** * * Functional description * * Export table data to a file located * on clients machine **************************************/ class __declspec( dllexport ) CBulkExportFile: public CBulkExport { public: CBulkExportFile(void); ~CBulkExportFile(void); int get_class_size(); /************************************** * * function: E x p o r t * ************************************** * * Functional description * * export table's data to file **************************************/ void Export(CConnection *conn, const char *table, const char *filename, const char *format, BULK_TRANSFER_CALLBACK *callback = 0); /************************************** * * function: O n S a v e * ************************************** * * Functional description * * save output **************************************/ virtual void OnSave(const void *data, const int &size); private: unsigned long m_err; // write to file error code HANDLE m_hfile; unsigned long m_total; BULK_TRANSFER_CALLBACK *m_transfer; }; };