Wincmd Packer progress
svn path=/Slnkdwf/trunk/; revision=12512
This commit is contained in:
@@ -339,14 +339,12 @@ bool CEPlotSectionImpl::SaveAsAscii(const CString &srcpath, const CString &destp
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CEPlotSectionImpl::SaveAsAscii(const CString &destpath)
|
||||
bool CEPlotSectionImpl::SaveAsAscii(const CString &destpath, EPlot_Progress_Action progress_action /* = NULL */)
|
||||
{
|
||||
ATLASSERT(!m_pW2DInStream); // Don't open first!
|
||||
|
||||
myWT_File my_input_file;
|
||||
my_input_file.set_eplotsection(this);
|
||||
my_input_file.SaveAsAscii(destpath);
|
||||
|
||||
return true;
|
||||
return my_input_file.SaveAsAscii(destpath, progress_action);
|
||||
};
|
||||
#endif
|
||||
@@ -95,7 +95,7 @@ WT_Result myWT_File::my_WSwrite (WT_File & file,int size,void const * buffer)
|
||||
return WT_Result::Success;
|
||||
};
|
||||
|
||||
bool myWT_File::SaveAsAscii(const CString &destpath)
|
||||
bool myWT_File::SaveAsAscii(const CString &destpath, EPlot_Progress_Action progress_action /*= NULL */)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -111,6 +111,14 @@ bool myWT_File::SaveAsAscii(const CString &destpath)
|
||||
// Do the actual reading.
|
||||
while (result = process_next_object(), result==WT_Result::Success)
|
||||
{
|
||||
if (progress_action)
|
||||
{
|
||||
int pos = file_pos();
|
||||
size_t sz = size();
|
||||
if (!progress_action(NULL /*progress_param*/, (sz==0)?0:double(pos)/sz))
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(current_object()->object_id())
|
||||
{
|
||||
case WT_Object::DWF_Header_ID:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
// CEPlotSection
|
||||
typedef BOOL (* EPlot_Progress_Action) (void *param, double progress);
|
||||
|
||||
class CEPlotSectionImpl
|
||||
{
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
#ifndef DWFTK_READ_ONLY
|
||||
bool SaveAs(const CString &destpath);
|
||||
static bool SaveAsAscii(const CString &srcpath, const CString &destpath);
|
||||
bool SaveAsAscii(const CString &destpath);
|
||||
bool SaveAsAscii(const CString &destpath, EPlot_Progress_Action action = NULL);
|
||||
STDMETHOD(Write)( const void *pv, ULONG cb,ULONG *pcbWritten);
|
||||
#endif
|
||||
STDMETHOD(Close)(void);
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
const unsigned int PaperColor() { return m_color; };
|
||||
#ifndef DWFTK_READ_ONLY
|
||||
bool SaveAsAscii(const CString &destpath);
|
||||
bool SaveAsAscii(const CString &destpath, EPlot_Progress_Action action = NULL);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user