Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

InstSrc Class Reference

An InstSrc. More...

#include <InstSrc.h>

Inheritance diagram for InstSrc:

CountedRep Rep List of all members.

Public Types

typedef InstSrcError Error
typedef PM::NumericISrcID NumericISrcID
typedef PM::NumericISrcID UniqueID
enum  Type { T_UNKNOWN, T_UnitedLinux, T_PlainDir, T_AUTODETECT }

Public Member Functions

NumericISrcID srcID () const
bool specialCache () const
void rememberPreviouslyDnlPackage (const Pathname &newpath_r) const
Pathname cache_dir () const
Pathname cache_descr_dir () const
Pathname cache_data_dir () const
Pathname cache_media_dir () const
constInstSrcDescrPtr descr () const
InstSrcDescrPtr descr ()
constInstSrcDataPtr data () const
InstSrcDataPtr data ()
constMediaAccessPtr media () const
MediaAccessPtr media ()
void preferredLocaleChanged () const
PMError enableSource ()
PMError disableSource ()
bool enabled () const
PMError providePackage (int medianr, const Pathname &name, const Pathname &dir, Pathname &path_r) const
PMError provideFile (int medianr, const Pathname &path, Pathname &file_r) const
PMError provideDir (int medianr, const Pathname &path, Pathname &dir_r) const
bool isRemote (void) const
PMError changeUrl (const Url &newUrl_r)
PMError releaseMedia (bool if_removable_r=false) const
std::ostream & dumpOn (std::ostream &str) const

Static Public Member Functions

std::string toString (const Type t)
Type fromString (std::string s)
PMError vconstruct (InstSrcPtr &nsrc_r, const Pathname &cachedir_r)
PMError vconstruct (InstSrcPtr &nsrc_r, const Pathname &cachedir_r, const Url &mediaurl_r, const Pathname &produduct_dir_r, Type type_r=T_AUTODETECT)

Static Public Attributes

const NumericISrcID noID

Protected Member Functions

 InstSrc ()
 ~InstSrc ()

Private Member Functions

 REP_BODY (InstSrc)
void _mgr_attach ()
Pathname cachePath (const Pathname &sub_r) const
PMError _init_openCache (const Pathname &cachedir_r)
PMError _init_newCache (const Pathname &cachedir_r)
PMError _init_newMedia (const Url &mediaurl_r, const Pathname &produduct_dir_r, Type type_r)
PMError writeDescrCache ()
PMError provideMedia (int medianr) const

Private Attributes

const NumericISrcID _srcID
Pathname _cache
bool _cache_deleteOnExit
bool _may_use_cache
Pathname previouslyDnlPackage
int _specialCache
MediaAccessPtr _media
InstSrcDescrPtr _descr
InstSrcDataPtr _data
int _medianr

Static Private Attributes

NumericISrcID _SRCID
const Pathname _c_descr_dir
const Pathname _c_data_dir
const Pathname _c_media_dir

Friends

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

Detailed Description

An InstSrc.


Member Typedef Documentation

typedef InstSrcError InstSrc::Error
 

default error class

typedef PM::NumericISrcID InstSrc::NumericISrcID
 

Unique InstSrc ID

typedef PM::NumericISrcID InstSrc::UniqueID
 


Member Enumeration Documentation

enum InstSrc::Type
 

Known types of InstSrc.

For each type there must be a concrete InstSrcData able to handle that kind of InstSrc. Autodetect switch in _init_newMedia must be adjusted, if types are added/removed.

See also:
InstSrcData
Enumeration values:
T_UNKNOWN 
T_UnitedLinux 
T_PlainDir 
T_AUTODETECT 


Constructor & Destructor Documentation

InstSrc::InstSrc  )  [protected]
 

constructor

Protected, because InstSrc is to be constructed via InstSrc::vconstruct only.

InstSrc::~InstSrc  )  [protected]
 

destructor


Member Function Documentation

PMError InstSrc::_init_newCache const Pathname cachedir_r  )  [private]
 

Used by InstSrc::vconstruct to set up an InstSrc from URL.

A new cachedir is created and initialized: cachedir must not exist, but parent dir must. _cache_deleteOnExit is set, so cachedir will be deleted if further initialisation fails. InstSrc::vconstruct will clear the flag, if initialisation succeeded.

PMError InstSrc::_init_newMedia const Url mediaurl_r,
const Pathname produduct_dir_r,
Type  type_r
[private]
 

Used by InstSrc::vconstruct to set up an InstSrc from URL.

Create MediaAcess and open media. Try to get InstSrcDescr from media (if type_r == T_UNKNOWN autodetect type). Media remains open.

PMError InstSrc::_init_openCache const Pathname cachedir_r  )  [private]
 

Used by InstSrc::vconstruct to set up an InstSrc from an existing cachedir.

Setup InstSrc from an (existing!) cachedir. cache_descr_dir must exist. InstSrcDescr is created from cache_descr_dir. MediaAccess is created, but media remains closed.

void InstSrc::_mgr_attach  )  [private]
 

Called from InstSrcManager on add to it's known sources pool. Unsets _cache_deleteOnExit, and writes description cache.

Pathname InstSrc::cache_data_dir  )  const [inline]
 

Full path of InstSrcData cache dir. If it does not exist, no chache write is desired.

Pathname InstSrc::cache_descr_dir  )  const [inline]
 

Full path of InstSrcDescr cache dir. If it does not exist, no chache write is desired.

Pathname InstSrc::cache_dir  )  const [inline]
 

Full path of cache_dir.

Pathname InstSrc::cache_media_dir  )  const [inline]
 

Full path of (prefered) madia attach point.

Pathname InstSrc::cachePath const Pathname sub_r  )  const [inline, private]
 

Helper function to combine _cache and subpaths.

PMError InstSrc::changeUrl const Url newUrl_r  ) 
 

change URL close current media and re-open with new media

InstSrcDataPtr InstSrc::data  )  [inline]
 

Access to installation source data

constInstSrcDataPtr InstSrc::data  )  const [inline]
 

Const access to installation source data

InstSrcDescrPtr InstSrc::descr  )  [inline]
 

Access to installation source description

constInstSrcDescrPtr InstSrc::descr  )  const [inline]
 

Const access to installation source description

PMError InstSrc::disableSource  ) 
 

From InstSrcManager: Release concrete InstSrcData. InstSrcData must withdraw provided Objects from Manager classes.

ostream & InstSrc::dumpOn std::ostream &  str  )  const [virtual]
 

Reimplemented from CountedRep.

bool InstSrc::enabled  )  const [inline]
 

True if enabled (i.e. providing data to Manager classes ).

PMError InstSrc::enableSource  ) 
 

From InstSrcManager: Provide concrete InstSrcData according to Type info stored in _descr. InstSrcData must provide Objects located on the media to the appropriate Manager classes.

InstSrc::Type InstSrc::fromString std::string  s  )  [static]
 

Restore Type from string (on restore from file). Keep it compatible with toString.

bool InstSrc::isRemote void   )  const
 

is the media for this source is remote and package provide takes some time

MediaAccessPtr InstSrc::media  )  [inline]
 

Access to media

constMediaAccessPtr InstSrc::media  )  const [inline]
 

Const access to media

void InstSrc::preferredLocaleChanged  )  const
 

Triggered on change of preferredLocale

PMError InstSrc::provideDir int  medianr,
const Pathname path,
Pathname dir_r
const
 

provide directory via medianr and path

path is relative to the media root

returns error code return local path in dir_r uses media change callback

PMError InstSrc::provideFile int  medianr,
const Pathname path,
Pathname file_r
const
 

provide file via medianr and path

path is relative to the media root

returns error code return local path in file_r uses media change callback

PMError InstSrc::provideMedia int  medianr  )  const [private]
 

provide media by number

PMError InstSrc::providePackage int  medianr,
const Pathname name,
const Pathname dir,
Pathname path_r
const
 

provide package via medianr, name, and sub-dir

name is the rpm file name dir is the directory below

returns local path or empty on error uses media change callback

PMError InstSrc::releaseMedia bool  if_removable_r = false  )  const
 

release media. if_removable is true: release if CD/DVD only.

void InstSrc::rememberPreviouslyDnlPackage const Pathname newpath_r  )  const
 

Don't use it except....

InstSrc::REP_BODY InstSrc   )  [private]
 

bool InstSrc::specialCache  )  const
 

Public, but for internal use by PMUlDataProvider only.

NumericISrcID InstSrc::srcID  )  const [inline]
 

Returns:
The unique InstSrc ID

string InstSrc::toString const Type  t  )  [static]
 

Convert Type to string (on save to file). Keep it compatible with fromString.

PMError InstSrc::vconstruct InstSrcPtr &  nsrc_r,
const Pathname cachedir_r,
const Url mediaurl_r,
const Pathname produduct_dir_r,
Type  type_r = T_AUTODETECT
[static]
 

Try to construct an InstSrc from an URL. type_r == T_UNKNOWN means autodetect type of InstSrc located at URL. The new InstSrc provides a valid description. Media is open.

Return new InstSrc via nsrc_r, or NULL if error.

See also:
_init_newCache

_init_newMedia

PMError InstSrc::vconstruct InstSrcPtr &  nsrc_r,
const Pathname cachedir_r
[static]
 

Construct an InstSrc from an (existing!) cachedir. The new InstSrc provides a valid description. Media is closed.

Return new InstSrc via nsrc_r, or NULL if error.

See also:
_init_openCache

PMError InstSrc::writeDescrCache  )  [private]
 

Sync InstSrcDescr to cache.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  str,
const Type  obj
[friend]
 

Output Type as string


Member Data Documentation

const Pathname InstSrc::_c_data_dir [static, private]
 

Subpath (below _cache) to cached InstSrcData.

const Pathname InstSrc::_c_descr_dir [static, private]
 

Subpath (below _cache) to cached InstSrcDescr.

const Pathname InstSrc::_c_media_dir [static, private]
 

Subpath (below _cache) to madia attach point.

Pathname InstSrc::_cache [private]
 

Cachedir to use.

bool InstSrc::_cache_deleteOnExit [private]
 

If true, delete cachedir in destructor.

InstSrcDataPtr InstSrc::_data [private]
 

content of media

InstSrcDescrPtr InstSrc::_descr [private]
 

description of media

bool InstSrc::_may_use_cache [private]
 

If true, data and description cache directories should be created and used. (false during installation, when no system is present)

MediaAccessPtr InstSrc::_media [private]
 

direct media access

int InstSrc::_medianr [mutable, private]
 

Current media number. Mutable because media provide/release are const methods.

int InstSrc::_specialCache [mutable, private]
 

For internal use by PMUlDataProvider only.

const NumericISrcID InstSrc::_srcID [private]
 

The unique InstSrc ID

PM::NumericISrcID InstSrc::_SRCID [static, private]
 

Static counter to create unique InstSrc IDs

const PM::NumericISrcID InstSrc::noID [static]
 

No or invalid unique InstSrc ID

Pathname InstSrc::previouslyDnlPackage [mutable, private]
 

for remote package provide


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by doxygen 1.3.6