OnMediaLocation.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_SOURCE_ONMEDIALOCATION_H
00013 #define ZYPP_SOURCE_ONMEDIALOCATION_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/base/Deprecated.h"
00018 #include "zypp/Pathname.h"
00019 #include "zypp/ByteCount.h"
00020 #include "zypp/CheckSum.h"
00021 
00023 namespace zypp
00024 { 
00025 
00027   //
00028   //    CLASS NAME : OnMediaLocation
00029   //
00037   class OnMediaLocation
00038   {
00039     friend std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
00040 
00041   public:
00043     OnMediaLocation()
00044     : _medianr( 0 )
00045     {}
00046 
00048     OnMediaLocation( const Pathname & filename_r, unsigned medianr_r = 1 )
00049     : _medianr( medianr_r )
00050     , _filename( filename_r )
00051     {}
00052 
00053   public:
00054     unsigned          medianr()        const { return _medianr; }
00055     const Pathname &  filename()       const { return _filename; }
00056     const CheckSum &  checksum()       const { return _checksum; }
00057     const ByteCount & downloadSize()   const { return _downloadsize; }
00058     const ByteCount & openSize()       const { return _opendownloadsize; }
00059     const CheckSum &  openChecksum()   const { return _openchecksum; }
00060 
00061   public:
00063     OnMediaLocation & unsetLocation()
00064     { _filename = Pathname(); _medianr = 0; return *this; }
00065 
00067     OnMediaLocation & setLocation( const Pathname & val_r,
00068                                    unsigned mediaNumber_r = 1 )
00069     { _filename = val_r; _medianr = mediaNumber_r; return *this; }
00070 
00072     OnMediaLocation & setDownloadSize( const ByteCount & val_r )
00073     { _downloadsize = val_r; return *this; }
00074 
00076     OnMediaLocation & setChecksum( const CheckSum & val_r )
00077     { _checksum = val_r; return *this; }
00078 
00080     OnMediaLocation & setOpenSize( const ByteCount & val_r )
00081     { _opendownloadsize = val_r; return *this; }
00082 
00084     OnMediaLocation & setOpenChecksum( const CheckSum & val_r )
00085     { _openchecksum = val_r; return *this; }
00086 
00087   public:
00089     ZYPP_DEPRECATED OnMediaLocation & xsetMedianr( unsigned val_r )
00090     { return changeMedianr( val_r ); }
00092     ZYPP_DEPRECATED OnMediaLocation & xsetFilename( const Pathname & val_r )
00093     {  return changeFilename( val_r ); }
00094 
00098     OnMediaLocation & changeMedianr( unsigned val_r )
00099     { _medianr = val_r; return *this; }
00100 
00104     OnMediaLocation & changeFilename( const Pathname & val_r )
00105     { _filename = val_r; return *this; }
00106 
00107   private:
00108     unsigned  _medianr;
00109     Pathname  _filename;
00110     CheckSum  _checksum;
00111     ByteCount _downloadsize;
00112     ByteCount _opendownloadsize;
00113     CheckSum _openchecksum;
00114   };
00116 
00118   std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
00119 
00121 } // namespace zypp
00123 #endif // ZYPP_SOURCE_ONMEDIALOCATION_H

Generated on Tue Sep 25 19:23:02 2007 for libzypp by  doxygen 1.5.3