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

PMYouPatchInfo Class Reference

facilitates reading and parsing patch information and patches from a given media. More...

#include <PMYouPatchInfo.h>

Inheritance diagram for PMYouPatchInfo:

CountedRep Rep List of all members.

Public Member Functions

 PMYouPatchInfo (PMYouSettingsPtr settings)
 ~PMYouPatchInfo ()
PMError getDirectory (bool useMediaDir)
PMError getPatches (std::vector< PMYouPatchPtr > &patches)
PMError readDir (std::vector< PMYouPatchPtr > &patches, bool useMediaDir=true)
PMError readFile (const Pathname &path, const std::string &fileName, PMYouPatchPtr &patch)
PMError parsePackages (const std::string &packages, const PMYouPatchPtr &patch)
PMError parseFiles (const std::string &files, const PMYouPatchPtr &patch)
PMError parseDeltas (const std::string &files, const PMYouPatchPtr &patch)
PMYouPackageDataProviderPtr packageDataProvider () const
PMError readDirectoryFile (const Pathname &, std::list< std::string > &patchFiles)
PMError processMediaDir ()
int mediaNumber (const PMYouPatchPtr &)

Protected Member Functions

std::string tagValueLocale (YOUPatchTagSet::Tags tagIndex, std::istream &input)
std::string tagValue (YOUPatchTagSet::Tags tagIndex, std::istream &input, const std::string &locale="")
std::string tagMultiValue (YOUPatchTagSet::Tags tagIndex, std::istream &input)
std::string tagValue (YOUPackageTagSet::Tags tag)
PMError createPackage (const PMYouPatchPtr &patch, std::istream &strm)
void readMediaMap (const Pathname &file)

Private Member Functions

 REP_BODY (PMYouPatchInfo)

Private Attributes

YOUPatchTagSet _patchTagSet
YOUPackageTagSet _packageTagSet
PMYouSettingsPtr _settings
MediaAccess _media
PMYouPackageDataProviderPtr _packageDataProvider
Url _mediaDirLastVisited
bool _doneDirectory
int _totalPatchFileCount
std::map< std::string, int > _mediaMap

Detailed Description

facilitates reading and parsing patch information and patches from a given media.

Patch information.


Constructor & Destructor Documentation

PMYouPatchInfo::PMYouPatchInfo PMYouSettingsPtr  settings  ) 
 

Constructor

Parameters:
settings Pointer to object representing the YOU settings

PMYouPatchInfo::~PMYouPatchInfo  ) 
 

Destructor


Member Function Documentation

PMError PMYouPatchInfo::createPackage const PMYouPatchPtr &  patch,
std::istream &  strm
[protected]
 

adds another package to the patch

Parameters:
patch Here the packages are added
strm From this stream the tags are read. Old position will be restored.

PMError PMYouPatchInfo::getDirectory bool  useMediaDir  ) 
 

First, goes through the mediamap file (when useMediaDir is true). Then, reads directory file (or just listing the directory) and adds all found patchfiles to _settings.

Parameters:
useMediaDir if true, read mediamap file patches file in media directory.

PMError PMYouPatchInfo::getPatches std::vector< PMYouPatchPtr > &  patches  ) 
 

reads patch files

Parameters:
patches Return: List of patch objects
Returns:
vector<PMYouPatchPtr> found patches

int PMYouPatchInfo::mediaNumber const PMYouPatchPtr &   ) 
 

Returns:
int media number from _mediaMap

PMYouPackageDataProviderPtr PMYouPatchInfo::packageDataProvider  )  const
 

PMError PMYouPatchInfo::parseDeltas const std::string &  files,
const PMYouPatchPtr &  patch
 

Parse Delta RPMs and add them to a patch

Parameters:
files Names of files to parse (separated by \n)
patch All parsed files will be added to the target of this "ptr".

PMError PMYouPatchInfo::parseFiles const std::string &  files,
const PMYouPatchPtr &  patch
 

Parse files and add them to a patch

Parameters:
files Names of files to parse (separated by
)
patch All parsed files will be added to the target of this "ptr".

PMError PMYouPatchInfo::parsePackages const std::string &  packages,
const PMYouPatchPtr &  patch
 

Parse package info, results go into _packageTagSet

Parameters:
packages String containing the package information.
patch Patch the packages belong to.

PMError PMYouPatchInfo::processMediaDir  ) 
 

reads the mediamap file (which patches are on which media instance) updates _settings

PMError PMYouPatchInfo::readDir std::vector< PMYouPatchPtr > &  patches,
bool  useMediaDir = true
 

Read patch info files from directory.

Parameters:
patches Return: list of patches
useMediaDir If true, read patch file from media directory.

PMError PMYouPatchInfo::readDirectoryFile const Pathname ,
std::list< std::string > &  patchFiles
 

reads a file and returns a list of all names except comments (should probably better be static protected ???)

Parameters:
Pathname Name of the file to parse
patchFile Return: List of names

PMError PMYouPatchInfo::readFile const Pathname path,
const std::string &  fileName,
PMYouPatchPtr &  patch
 

Read patch info from file.

Parameters:
path File path of package info file.
fileName Name of patch file.
patch Return: patch

void PMYouPatchInfo::readMediaMap const Pathname file  )  [protected]
 

PMYouPatchInfo::REP_BODY PMYouPatchInfo   )  [private]
 

std::string PMYouPatchInfo::tagMultiValue YOUPatchTagSet::Tags  tagIndex,
std::istream &  input
[protected]
 

string PMYouPatchInfo::tagValue YOUPackageTagSet::Tags  tag  )  [protected]
 

std::string PMYouPatchInfo::tagValue YOUPatchTagSet::Tags  tagIndex,
std::istream &  input,
const std::string &  locale = ""
[protected]
 

string PMYouPatchInfo::tagValueLocale YOUPatchTagSet::Tags  tagIndex,
std::istream &  input
[protected]
 

gets tag from _patchTagSet by index ???

Parameters:
tagIndex Index of tag
input ??? mir is here ???


Member Data Documentation

bool PMYouPatchInfo::_doneDirectory [private]
 

MediaAccess PMYouPatchInfo::_media [private]
 

Url PMYouPatchInfo::_mediaDirLastVisited [private]
 

The last media for which the mediamap file was read successfully. This attribute is handled exclusively by processMediaDir()

std::map<std::string,int> PMYouPatchInfo::_mediaMap [private]
 

PMYouPackageDataProviderPtr PMYouPatchInfo::_packageDataProvider [private]
 

YOUPackageTagSet PMYouPatchInfo::_packageTagSet [private]
 

YOUPatchTagSet PMYouPatchInfo::_patchTagSet [private]
 

PMYouSettingsPtr PMYouPatchInfo::_settings [private]
 

int PMYouPatchInfo::_totalPatchFileCount [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Sep 12 21:52:14 2005 for yast2-packagemanager by  doxygen 1.4.4