//---------------------------------------------------------------------------
#pragma hdrstop
#include "DExcelBrokerBase.h"
//---------------------------------------------------------------------------
//构造函数
//只读、只写、读写都可以
DExcelBrokerBase::DExcelBrokerBase( const AnsiString &sFilePath, const EConType eType )
{
switch( eType )
{
case EXCRead:
s_gFileReadPath = sFilePath;
break;
case EXCWrite:
s_gFileWritePath = sFilePath;
break;
case EXCAll:
s_gFileReadPath = sFilePath;
s_gFileWritePath = sFilePath;
break;
default:
break;
}
}
//---------------------------------------------------------------------------
//读写同时
DExcelBrokerBase::DExcelBrokerBase( const AnsiString &sFileReadPath, const AnsiString &sFileWritePath )
{
s_gFileReadPath = sFileReadPath;
s_gFileWritePath = sFileWritePath;
}
//---------------------------------------------------------------------------
//析构函数
DExcelBrokerBase::~DExcelBrokerBase()
{
//
if ( !v_gEReadApp.IsEmpty() )
{
CloseReadObj();
v_gEReadApp = NULL;
}
if ( !v_gEReadCell.IsEmpty() )
{
v_gEReadCell.Clear();
v_gEReadCell = NULL;
}
if ( !v_gEReadSheet.IsEmpty() )
{
v_gEReadSheet.Clear();
v_gEReadSheet = NULL;
}
if ( !v_gEReadSingleBook.IsEmpty() )
{
v_gEReadSingleBook.Clear();
v_gEReadSingleBook = NULL;
}
if ( !v_gEReadAllBooks.IsEmpty() )
{
v_gEReadAllBooks.Clear();
v_gEReadAllBooks = NULL;
}
//