libzypp 17.37.10

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-core/base/PtrTypes.h>
17#include <zypp-core/Pathname.h>
18#include <zypp-core/ByteCount.h>
19#include <zypp-core/CheckSum.h>
20
22 namespace zypp
23{
36 class ZYPP_API OnMediaLocation
37 {
38 friend std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
39 friend std::ostream & dumpOn( std::ostream & str, const OnMediaLocation & obj );
40
41 public:
43 OnMediaLocation();
44
46 OnMediaLocation( Pathname filename_r, unsigned medianr_r = 1 );
47
49 ~OnMediaLocation();
50
51 public:
53 const Pathname & filename() const;
54
56 unsigned medianr() const;
57
58
60 OnMediaLocation & setLocation( Pathname filename_r, unsigned medianr_r = 1 );
61
63 OnMediaLocation & unsetLocation();
64
65
67 OnMediaLocation & changeFilename( Pathname filename_r );
68
70 OnMediaLocation & changeMedianr( unsigned medianr_r );
71
73 OnMediaLocation & prependPath( const Pathname & prefix_r );
74
75 public:
80 bool optional() const;
82 OnMediaLocation & setOptional( bool val );
83
84 public:
86 const ByteCount & downloadSize() const;
88 OnMediaLocation & setDownloadSize( ByteCount val_r );
89
91 const CheckSum & checksum() const;
93 OnMediaLocation & setChecksum( CheckSum val_r );
94
95 public:
97 const ByteCount & openSize() const;
99 OnMediaLocation & setOpenSize( ByteCount val_r );
100
102 const CheckSum & openChecksum() const;
104 OnMediaLocation & setOpenChecksum( CheckSum val_r );
105
106 public:
108 const ByteCount & headerSize() const;
110 OnMediaLocation & setHeaderSize( ByteCount val_r );
111
113 const CheckSum & headerChecksum() const;
115 OnMediaLocation & setHeaderChecksum( CheckSum val_r );
116
118 const Pathname & deltafile() const;
120 OnMediaLocation & setDeltafile( Pathname path );
121
123 bool mirrorsAllowed() const;
124
126 OnMediaLocation &setMirrorsAllowed( bool set = true );
127
128
129 public:
130 class Impl;
131 private:
132 RWCOW_pointer<Impl> _pimpl;
133 };
134
136 std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj );
137
139 std::ostream & dumOn( std::ostream & str, const OnMediaLocation & obj );
140
141} // namespace zypp
143#endif // ZYPP_SOURCE_ONMEDIALOCATION_H
zypp::ByteCount
Store and operate with byte count.
Definition ByteCount.h:32
zypp::CheckSum
Definition CheckSum.h:34
zypp::OnMediaLocation::Impl
OnMediaLocation implementation.
Definition onmedialocation.cc:28
zypp::OnMediaLocation
Describes a resource file located on a medium.
Definition onmedialocation.h:37
zypp::OnMediaLocation::optional
bool optional() const
Whether this is an optional resource.
Definition onmedialocation.cc:111
zypp::OnMediaLocation::downloadSize
const ByteCount & downloadSize() const
The size of the resource on the server.
Definition onmedialocation.cc:117
zypp::OnMediaLocation::setDownloadSize
OnMediaLocation & setDownloadSize(ByteCount val_r)
Set the downloadSize.
Definition onmedialocation.cc:120
zypp::OnMediaLocation::filename
const Pathname & filename() const
The path to the resource on the medium.
Definition onmedialocation.cc:90
zypp::OnMediaLocation::setMirrorsAllowed
OnMediaLocation & setMirrorsAllowed(bool set=true)
Enables or disables the use of mirrors when fetching this file.
Definition onmedialocation.cc:162
zypp::OnMediaLocation::setOpenSize
OnMediaLocation & setOpenSize(ByteCount val_r)
Set the openSize.
Definition onmedialocation.cc:132
zypp::OnMediaLocation::changeMedianr
OnMediaLocation & changeMedianr(unsigned medianr_r)
Individual manipulation of medianr (prefer setLocation).
Definition onmedialocation.cc:105
zypp::OnMediaLocation::dumOn
std::ostream & dumOn(std::ostream &str, const OnMediaLocation &obj)
Verbose stream output.
zypp::OnMediaLocation::openSize
const ByteCount & openSize() const
The size of the resource once it has been uncompressed or unpacked.
Definition onmedialocation.cc:129
zypp::OnMediaLocation::deltafile
const Pathname & deltafile() const
The existing deltafile that can be used to reduce download size ( zchunk or metalink )
Definition onmedialocation.cc:153
zypp::OnMediaLocation::headerSize
const ByteCount & headerSize() const
The size of the header prepending the resource (e.g.
Definition onmedialocation.cc:141
zypp::OnMediaLocation::setChecksum
OnMediaLocation & setChecksum(CheckSum val_r)
Set the checksum.
Definition onmedialocation.cc:126
zypp::OnMediaLocation::medianr
unsigned medianr() const
The media number the resource is located on.
Definition onmedialocation.cc:93
zypp::OnMediaLocation::headerChecksum
const CheckSum & headerChecksum() const
The checksum of the header prepending the resource (e.g.
Definition onmedialocation.cc:147
zypp::OnMediaLocation::changeFilename
OnMediaLocation & changeFilename(Pathname filename_r)
Individual manipulation of filename (prefer setLocation).
Definition onmedialocation.cc:102
zypp::OnMediaLocation::_pimpl
RWCOW_pointer< Impl > _pimpl
Implementation class.
Definition onmedialocation.h:132
zypp::OnMediaLocation::setHeaderSize
OnMediaLocation & setHeaderSize(ByteCount val_r)
Set the headerSize.
Definition onmedialocation.cc:144
zypp::OnMediaLocation::checksum
const CheckSum & checksum() const
The checksum of the resource on the server.
Definition onmedialocation.cc:123
zypp::OnMediaLocation::OnMediaLocation
OnMediaLocation()
Default Ctor indicating no media access.
Definition onmedialocation.cc:78
zypp::OnMediaLocation::prependPath
OnMediaLocation & prependPath(const Pathname &prefix_r)
Prepend the filename with prefix_r.
Definition onmedialocation.cc:108
zypp::OnMediaLocation::openChecksum
const CheckSum & openChecksum() const
The checksum of the resource once it has been uncompressed or unpacked.
Definition onmedialocation.cc:135
zypp::OnMediaLocation::unsetLocation
OnMediaLocation & unsetLocation()
Unset filename and set medianr to 0.
Definition onmedialocation.cc:99
zypp::OnMediaLocation::setLocation
OnMediaLocation & setLocation(Pathname filename_r, unsigned medianr_r=1)
Set filename_r and medianr_r (defaults to 1).
Definition onmedialocation.cc:96
zypp::OnMediaLocation::setOpenChecksum
OnMediaLocation & setOpenChecksum(CheckSum val_r)
Set the openChecksum.
Definition onmedialocation.cc:138
zypp::OnMediaLocation::setHeaderChecksum
OnMediaLocation & setHeaderChecksum(CheckSum val_r)
Set the headerChecksum.
Definition onmedialocation.cc:150
zypp::OnMediaLocation::mirrorsAllowed
bool mirrorsAllowed() const
The requested file is allowed to be fetched via mirrors ( defaults to true )
Definition onmedialocation.cc:159
zypp::OnMediaLocation::setOptional
OnMediaLocation & setOptional(bool val)
Set whether the resource is optional.
Definition onmedialocation.cc:114
zypp::OnMediaLocation::setDeltafile
OnMediaLocation & setDeltafile(Pathname path)
Set the deltafile.
Definition onmedialocation.cc:156
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
str
String related utilities and Regular expression matching.
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::dumpOn
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
Definition Capability.cc:580
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition SerialNumber.cc:52
zypp::ZYPP_API
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469
ByteCount.h
CheckSum.h
Pathname.h
PtrTypes.h