Matrix Science header

ms_http_helper_progress.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_http_helper_progress.hpp                                                 #
00004 # 'msparser' toolkit                                                         #
00005 # Hold information about the progress of an internet file transfer           #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2013 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011  * @(#)$Source: parser/inc/ms_http_helper_progress.hpp $
00012  * @(#)$Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_7_0-0-g3d31d2559e $
00013  * @(#)$Date: 2018-07-30 16:23:53 +0100 $
00014 ##############################################################################
00015  */
00016 
00017 #ifndef MS_HTTP_HELPER_PROGRESS_HPP
00018 #define MS_HTTP_HELPER_PROGRESS_HPP
00019 
00020 
00021 #include <string>
00022 
00023 namespace matrix_science
00024 {
00030 
00031 
00041     class MS_MASCOTRESFILE_API ms_http_helper_progress
00042     {
00043         public:
00044 #ifndef SWIG
00045 
00046             ms_http_helper_progress();
00047 #endif
00048 
00050             void setAbort();
00051             
00053             bool isAbortSet() const;
00054             
00056             bool isStarted() const;
00057 
00059             UINT64 getCurrentBytes() const;
00060             UINT64 current() const { return getCurrentBytes(); } // Deprecated and undocumented - not a normal Parser function name
00061 
00063             UINT64 getTotalBytes() const;
00064             UINT64 total() const { return getTotalBytes(); } // Deprecated and undocumented - not a normal Parser function name
00065             
00067             double getProportion() const;
00068             double proportion() const { return getProportion(); } // Deprecated and undocumented - not a normal Parser function name
00069             
00071             bool isComplete() const;
00072 
00073         private:
00074             void setStarted();
00075             void setProgress(UINT64 current, UINT64 total);
00076             void setComplete();
00077 
00078             bool   abort_;
00079             bool   isStarted_;
00080             bool   isComplete_;
00081             UINT64 current_;
00082             UINT64 total_;
00083             int    count_;
00084             double proportion_;
00085 
00086         friend class ms_http_helper;
00087     };
00088      // end of http_client_group
00090 } // namespace matrix_science
00091 
00092 #endif // MS_HTTP_HELPER_PROGRESS_HPP
00093 
00094 /*------------------------------- End of File -------------------------------*/

Copyright © 2020 Matrix Science Ltd.  All Rights Reserved. Generated on Sat Jan 25 2020 01:26:14