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: /vol/cvsroot/parser/inc/ms_http_helper_progress.hpp,v $
00012  * @(#)$Revision: 1.3 $
00013  * @(#)$Date: 2015/06/16 15:30:11 $
00014 ##############################################################################
00015  */
00016 
00017 #ifndef MS_HTTP_HELPER_PROGRESS_HPP
00018 #define MS_HTTP_HELPER_PROGRESS_HPP
00019 
00020 #ifdef _WIN32
00021 #pragma warning(disable:4251)   // Don't want all classes to be exported
00022 #pragma warning(disable:4786)   // Debug symbols too long
00023 #   ifndef _MATRIX_USE_STATIC_LIB
00024 #       ifdef MS_MASCOTRESFILE_EXPORTS
00025 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00026 #       else
00027 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00028 #       endif
00029 #   else
00030 #       define MS_MASCOTRESFILE_API
00031 #   endif
00032 #else
00033 #   define MS_MASCOTRESFILE_API
00034 #endif
00035 
00036 #include <string>
00037 
00038 namespace matrix_science
00039 {
00045 
00046 
00056     class MS_MASCOTRESFILE_API ms_http_helper_progress
00057     {
00058         public:
00059 #ifndef SWIG
00060 
00061             ms_http_helper_progress();
00062 #endif
00063 
00065             void setAbort();
00066             
00068             bool isAbortSet() const;
00069             
00071             bool isStarted() const;
00072 
00074             UINT64 getCurrentBytes() const;
00075             UINT64 current() const { return getCurrentBytes(); } // Deprecated and undocumented - not a normal Parser function name
00076 
00078             UINT64 getTotalBytes() const;
00079             UINT64 total() const { return getTotalBytes(); } // Deprecated and undocumented - not a normal Parser function name
00080             
00082             double getProportion() const;
00083             double proportion() const { return getProportion(); } // Deprecated and undocumented - not a normal Parser function name
00084             
00086             bool isComplete() const;
00087 
00088         private:
00089             void setStarted();
00090             void setProgress(UINT64 current, UINT64 total);
00091             void setComplete();
00092 
00093             bool   abort_;
00094             bool   isStarted_;
00095             bool   isComplete_;
00096             UINT64 current_;
00097             UINT64 total_;
00098             int    count_;
00099             double proportion_;
00100 
00101         friend class ms_http_helper;
00102     };
00103      // end of http_client_group
00105 } // namespace matrix_science
00106 
00107 #endif // MS_HTTP_HELPER_PROGRESS_HPP
00108 
00109 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51