libzypp  17.1.1
zypp::OnMediaLocation Class Reference

Describes a path on a certain media amongs as the information required to download it, like its media number, checksum and size. More...

#include <OnMediaLocation.h>

Public Member Functions

 OnMediaLocation ()
 Default ctor indicating no media access. More...
 
 OnMediaLocation (const Pathname &filename_r, unsigned medianr_r=1)
 Ctor taking a filename and media number (defaults to 1). More...
 
unsigned medianr () const
 media number where the resource is located. More...
 
const Pathnamefilename () const
 The path to the resource relatve to the url and path. More...
 
const CheckSumchecksum () const
 the checksum of the resource More...
 
const ByteCountdownloadSize () const
 The size of the resource on the server. More...
 
const ByteCountopenSize () const
 The size of the resource once it has been uncompressed or unpacked. More...
 
const CheckSumopenChecksum () const
 The checksum of the resource once it has been uncompressed or unpacked. More...
 
const bool optional () const
 whether this is an optional resource. More...
 
OnMediaLocationunsetLocation ()
 Unset filename and set medianr to 0. More...
 
OnMediaLocationsetLocation (const Pathname &val_r, unsigned mediaNumber_r=1)
 Set filename and media number (defaults to 1). More...
 
OnMediaLocationsetDownloadSize (const ByteCount &val_r)
 Set the files size. More...
 
OnMediaLocationsetChecksum (const CheckSum &val_r)
 Set the files checksum. More...
 
OnMediaLocationsetOpenSize (const ByteCount &val_r)
 Set the files open (uncompressed) size. More...
 
OnMediaLocationsetOpenChecksum (const CheckSum &val_r)
 Set the files open (uncompressed) checksum. More...
 
OnMediaLocationsetOptional (bool val)
 Set the whether the resource is optional or not. More...
 
OnMediaLocationchangeMedianr (unsigned val_r)
 Individual manipulation of medianr (prefer setLocation). More...
 
OnMediaLocationchangeFilename (const Pathname &val_r)
 Individual manipulation of filename (prefer setLocation). More...
 
OnMediaLocationprependPath (const Pathname &prefix_r)
 Prepend the filename with prefix_r. More...
 

Private Attributes

unsigned _medianr
 
Pathname _filename
 
CheckSum _checksum
 
ByteCount _downloadsize
 
ByteCount _opendownloadsize
 
CheckSum _openchecksum
 
bool _optional
 

Friends

std::ostream & operator<< (std::ostream &str, const OnMediaLocation &obj)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const OnMediaLocation &obj)
 

Detailed Description

Describes a path on a certain media amongs as the information required to download it, like its media number, checksum and size.

It does not specify the URI of the file.

Media number 0 usually indicates no media access.

Todo:
Implement cheap copy via COW.

Definition at line 39 of file OnMediaLocation.h.

Constructor & Destructor Documentation

◆ OnMediaLocation() [1/2]

zypp::OnMediaLocation::OnMediaLocation ( )
inline

Default ctor indicating no media access.

Definition at line 45 of file OnMediaLocation.h.

◆ OnMediaLocation() [2/2]

zypp::OnMediaLocation::OnMediaLocation ( const Pathname filename_r,
unsigned  medianr_r = 1 
)
inline

Ctor taking a filename and media number (defaults to 1).

Definition at line 51 of file OnMediaLocation.h.

Member Function Documentation

◆ medianr()

unsigned zypp::OnMediaLocation::medianr ( ) const
inline

media number where the resource is located.

for a url cd:// this could be 1..N. for a url of type http://host/path/CD1, a media number 2 means looking on http://host/path/CD1/../CD2

Definition at line 64 of file OnMediaLocation.h.

◆ filename()

const Pathname& zypp::OnMediaLocation::filename ( ) const
inline

The path to the resource relatve to the url and path.

If the base is http://novell.com/download/repository, the resource filename could be "/repodata/repomd.xml"

Definition at line 70 of file OnMediaLocation.h.

◆ checksum()

const CheckSum& zypp::OnMediaLocation::checksum ( ) const
inline

the checksum of the resource

Definition at line 74 of file OnMediaLocation.h.

◆ downloadSize()

const ByteCount& zypp::OnMediaLocation::downloadSize ( ) const
inline

The size of the resource on the server.

Therefore the size of the download.

Definition at line 79 of file OnMediaLocation.h.

◆ openSize()

const ByteCount& zypp::OnMediaLocation::openSize ( ) const
inline

The size of the resource once it has been uncompressed or unpacked.

If the file is file.txt.gz then this is the size of file.txt

Definition at line 86 of file OnMediaLocation.h.

◆ openChecksum()

const CheckSum& zypp::OnMediaLocation::openChecksum ( ) const
inline

The checksum of the resource once it has been uncompressed or unpacked.

If the file is file.txt.gz then this is the checksum of file.txt

Definition at line 93 of file OnMediaLocation.h.

◆ optional()

const bool zypp::OnMediaLocation::optional ( ) const
inline

whether this is an optional resource.

That is a file that may not be present. This is just a hint to the resource downloader to not error in case the not found resource is not found.

Definition at line 100 of file OnMediaLocation.h.

◆ unsetLocation()

OnMediaLocation& zypp::OnMediaLocation::unsetLocation ( )
inline

Unset filename and set medianr to 0.

Definition at line 104 of file OnMediaLocation.h.

◆ setLocation()

OnMediaLocation& zypp::OnMediaLocation::setLocation ( const Pathname val_r,
unsigned  mediaNumber_r = 1 
)
inline

Set filename and media number (defaults to 1).

Definition at line 108 of file OnMediaLocation.h.

◆ setDownloadSize()

OnMediaLocation& zypp::OnMediaLocation::setDownloadSize ( const ByteCount val_r)
inline

Set the files size.

Definition at line 113 of file OnMediaLocation.h.

◆ setChecksum()

OnMediaLocation& zypp::OnMediaLocation::setChecksum ( const CheckSum val_r)
inline

Set the files checksum.

Definition at line 117 of file OnMediaLocation.h.

◆ setOpenSize()

OnMediaLocation& zypp::OnMediaLocation::setOpenSize ( const ByteCount val_r)
inline

Set the files open (uncompressed) size.

Definition at line 121 of file OnMediaLocation.h.

◆ setOpenChecksum()

OnMediaLocation& zypp::OnMediaLocation::setOpenChecksum ( const CheckSum val_r)
inline

Set the files open (uncompressed) checksum.

Definition at line 125 of file OnMediaLocation.h.

◆ setOptional()

OnMediaLocation& zypp::OnMediaLocation::setOptional ( bool  val)
inline

Set the whether the resource is optional or not.

See also
optional

Definition at line 132 of file OnMediaLocation.h.

◆ changeMedianr()

OnMediaLocation& zypp::OnMediaLocation::changeMedianr ( unsigned  val_r)
inline

Individual manipulation of medianr (prefer setLocation).

Using setLocation is prefered as us usually have to adjust filename and medianr in sync.

Definition at line 141 of file OnMediaLocation.h.

◆ changeFilename()

OnMediaLocation& zypp::OnMediaLocation::changeFilename ( const Pathname val_r)
inline

Individual manipulation of filename (prefer setLocation).

Using setLocation is preferedas us usually have to adjust filename and medianr in sync.

Definition at line 149 of file OnMediaLocation.h.

◆ prependPath()

OnMediaLocation& zypp::OnMediaLocation::prependPath ( const Pathname prefix_r)
inline

Prepend the filename with prefix_r.

Definition at line 153 of file OnMediaLocation.h.

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  str,
const OnMediaLocation obj 
)
friend

Definition at line 28 of file OnMediaLocation.cc.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  str,
const OnMediaLocation obj 
)
related

Stream output

Definition at line 28 of file OnMediaLocation.cc.

Member Data Documentation

◆ _medianr

unsigned zypp::OnMediaLocation::_medianr
private

Definition at line 157 of file OnMediaLocation.h.

◆ _filename

Pathname zypp::OnMediaLocation::_filename
private

Definition at line 158 of file OnMediaLocation.h.

◆ _checksum

CheckSum zypp::OnMediaLocation::_checksum
private

Definition at line 159 of file OnMediaLocation.h.

◆ _downloadsize

ByteCount zypp::OnMediaLocation::_downloadsize
private

Definition at line 160 of file OnMediaLocation.h.

◆ _opendownloadsize

ByteCount zypp::OnMediaLocation::_opendownloadsize
private

Definition at line 161 of file OnMediaLocation.h.

◆ _openchecksum

CheckSum zypp::OnMediaLocation::_openchecksum
private

Definition at line 162 of file OnMediaLocation.h.

◆ _optional

bool zypp::OnMediaLocation::_optional
private

Definition at line 163 of file OnMediaLocation.h.


The documentation for this class was generated from the following file: