libzypp  15.28.6
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 Pathname & filename () 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...
 

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

zypp::OnMediaLocation::OnMediaLocation ( )
inline

Default ctor indicating no media access.

Definition at line 45 of file OnMediaLocation.h.

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

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.

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.

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

the checksum of the resource

Definition at line 74 of file OnMediaLocation.h.

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.

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.

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.

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.

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

Unset filename and set medianr to 0.

Definition at line 104 of file OnMediaLocation.h.

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.

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

Set the files size.

Definition at line 113 of file OnMediaLocation.h.

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

Set the files checksum.

Definition at line 117 of file OnMediaLocation.h.

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

Set the files open (uncompressed) size.

Definition at line 121 of file OnMediaLocation.h.

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

Set the files open (uncompressed) checksum.

Definition at line 125 of file OnMediaLocation.h.

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.

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.

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.

Friends And Related Function Documentation

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

Definition at line 28 of file OnMediaLocation.cc.

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

Stream output

Definition at line 28 of file OnMediaLocation.cc.

Member Data Documentation

unsigned zypp::OnMediaLocation::_medianr
private

Definition at line 153 of file OnMediaLocation.h.

Pathname zypp::OnMediaLocation::_filename
private

Definition at line 154 of file OnMediaLocation.h.

CheckSum zypp::OnMediaLocation::_checksum
private

Definition at line 155 of file OnMediaLocation.h.

ByteCount zypp::OnMediaLocation::_downloadsize
private

Definition at line 156 of file OnMediaLocation.h.

ByteCount zypp::OnMediaLocation::_opendownloadsize
private

Definition at line 157 of file OnMediaLocation.h.

CheckSum zypp::OnMediaLocation::_openchecksum
private

Definition at line 158 of file OnMediaLocation.h.

bool zypp::OnMediaLocation::_optional
private

Definition at line 159 of file OnMediaLocation.h.


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