libzypp  17.28.4
OnMediaLocation.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
11 #ifndef ZYPP_SOURCE_ONMEDIALOCATION_H
12 #define ZYPP_SOURCE_ONMEDIALOCATION_H
13 
14 #include <iosfwd>
15 
16 #include <zypp/base/PtrTypes.h>
17 
18 #include <zypp/APIConfig.h>
19 #include <zypp/Pathname.h>
20 #include <zypp/ByteCount.h>
21 #include <zypp/CheckSum.h>
22 
24 namespace zypp
25 {
39  {
40  friend std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
41  friend std::ostream & dumpOn( std::ostream & str, const OnMediaLocation & obj );
42 
43  public:
46 
48  OnMediaLocation( Pathname filename_r, unsigned medianr_r = 1 );
49 
52 
53  public:
55  const Pathname & filename() const;
56 
58  unsigned medianr() const;
59 
60 
62  OnMediaLocation & setLocation( Pathname filename_r, unsigned medianr_r = 1 );
63 
66 
67 
69  OnMediaLocation & changeFilename( Pathname filename_r );
70 
72  OnMediaLocation & changeMedianr( unsigned medianr_r );
73 
75  OnMediaLocation & prependPath( const Pathname & prefix_r );
76 
77  public:
82  bool optional() const;
84  OnMediaLocation & setOptional( bool val );
85 
86  public:
88  const ByteCount & downloadSize() const;
91 
93  const CheckSum & checksum() const;
96 
97  public:
99  const ByteCount & openSize() const;
102 
104  const CheckSum & openChecksum() const;
107 
108  public:
110  const ByteCount & headerSize() const;
113 
115  const CheckSum & headerChecksum() const;
118 
120  const Pathname & deltafile() const;
123 
124 
125  public:
126  class Impl;
127  private:
129  };
130 
132  std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
133 
135  std::ostream & dumOn( std::ostream & str, const OnMediaLocation & obj );
136 
137 } // namespace zypp
139 #endif // ZYPP_SOURCE_ONMEDIALOCATION_H
Store and operate with byte count.
Definition: ByteCount.h:31
Describes a resource file located on a medium.
bool optional() const
Whether this is an optional resource.
const ByteCount & downloadSize() const
The size of the resource on the server.
OnMediaLocation & setDownloadSize(ByteCount val_r)
Set the downloadSize.
const Pathname & filename() const
The path to the resource on the medium.
friend std::ostream & operator<<(std::ostream &str, const OnMediaLocation &obj)
OnMediaLocation & setOpenSize(ByteCount val_r)
Set the openSize.
OnMediaLocation & changeMedianr(unsigned medianr_r)
Individual manipulation of medianr (prefer setLocation).
std::ostream & dumOn(std::ostream &str, const OnMediaLocation &obj)
Verbose stream output.
const ByteCount & openSize() const
The size of the resource once it has been uncompressed or unpacked.
friend std::ostream & dumpOn(std::ostream &str, const OnMediaLocation &obj)
const Pathname & deltafile() const
The existing deltafile that can be used to reduce download size ( zchunk or metalink )
const ByteCount & headerSize() const
The size of the header prepending the resource (e.g.
OnMediaLocation & setChecksum(CheckSum val_r)
Set the checksum.
unsigned medianr() const
The media number the resource is located on.
const CheckSum & headerChecksum() const
The checksum of the header prepending the resource (e.g.
OnMediaLocation & changeFilename(Pathname filename_r)
Individual manipulation of filename (prefer setLocation).
RWCOW_pointer< Impl > _pimpl
Implementation class.
OnMediaLocation & setHeaderSize(ByteCount val_r)
Set the headerSize.
const CheckSum & checksum() const
The checksum of the resource on the server.
OnMediaLocation()
Default Ctor indicating no media access.
OnMediaLocation & prependPath(const Pathname &prefix_r)
Prepend the filename with prefix_r.
const CheckSum & openChecksum() const
The checksum of the resource once it has been uncompressed or unpacked.
OnMediaLocation & unsetLocation()
Unset filename and set medianr to 0.
OnMediaLocation & setLocation(Pathname filename_r, unsigned medianr_r=1)
Set filename_r and medianr_r (defaults to 1).
OnMediaLocation & setOpenChecksum(CheckSum val_r)
Set the openChecksum.
OnMediaLocation & setHeaderChecksum(CheckSum val_r)
Set the headerChecksum.
OnMediaLocation & setOptional(bool val)
Set whether the resource is optional.
OnMediaLocation & setDeltafile(Pathname path)
Set the deltafile.
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
std::ostream & operator<<(std::ostream &str, const InputStream &obj)
Definition: InputStream.cc:166
OnMediaLocation implementation.