- Create the cache directly from the schema (installed) file.
[platform/upstream/libzypp.git] / zypp / OnMediaLocation.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/source/OnMediaLocation.h
10  *
11 */
12 #ifndef ZYPP_SOURCE_ONMEDIALOCATION_H
13 #define ZYPP_SOURCE_ONMEDIALOCATION_H
14
15 #include <iosfwd>
16
17 #include "zypp/Pathname.h"
18 #include "zypp/ByteCount.h"
19 #include "zypp/CheckSum.h"
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp
23 { /////////////////////////////////////////////////////////////////
24
25   ///////////////////////////////////////////////////////////////////
26   //
27   //    CLASS NAME : OnMediaLocation
28   //
29   /** 
30     * Describes a path ona certain media amongs as the information
31     * required to download it, like its media number, checksum and
32     * size.
33     * it does not specifies the URI of the file.
34   */
35   class OnMediaLocation
36   {
37     friend std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
38
39   public:
40     /** Ctor */
41     OnMediaLocation()
42     : _medianr( 1 )
43     {}
44
45   public:
46     unsigned          medianr()      const { return _medianr; }
47     const Pathname &  filename()     const { return _filename; }
48     const CheckSum &  checksum()     const { return _checksum; }
49     const ByteCount & downloadsize() const { return _downloadsize; }
50
51   public:
52     OnMediaLocation & medianr( unsigned val_r )               { _medianr = val_r; return *this; }
53     OnMediaLocation & filename( const Pathname & val_r )      { _filename = val_r; return *this; }
54     OnMediaLocation & checksum( const CheckSum & val_r )      { _checksum = val_r; return *this; }
55     OnMediaLocation & downloadsize( const ByteCount & val_r ) { _downloadsize = val_r; return *this; }
56
57   private:
58     unsigned  _medianr;
59     Pathname  _filename;
60     CheckSum  _checksum;
61     ByteCount _downloadsize;
62   };
63   ///////////////////////////////////////////////////////////////////
64
65   /** \relates OnMediaLocation Stream output */
66   std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
67
68   /////////////////////////////////////////////////////////////////
69 } // namespace zypp
70 ///////////////////////////////////////////////////////////////////
71 #endif // ZYPP_SOURCE_ONMEDIALOCATION_H