zypp::parser::yum::FileReaderBase::BaseImpl Class Reference

#include <FileReaderBaseImpl.h>

Inheritance diagram for zypp::parser::yum::FileReaderBase::BaseImpl:
[legend]

List of all members.

Public Types

enum  Tag {
  tag_NONE, tag_package, tag_format, tag_patch,
  tag_atoms, tag_script, tag_message, tag_pkgfiles,
  tag_deltarpm, tag_patchrpm, tag_pattern, tag_product
}
 Enumeration of some YUM metadata xml tags. More...

Public Member Functions

 BaseImpl ()
 CTOR.
bool consumePackageNode (xml::Reader &reader_r, data::Packagebase_Ptr &package_ptr)
 Process package node and its subtree.
bool consumeFormatNode (xml::Reader &reader_r, data::Packagebase_Ptr &package_ptr)
 Function for processing all format tag subtree nodes.
bool consumeDependency (xml::Reader &reader_r, data::Dependencies &deps_r)
 Processes RPM dependency tags (rpm:entry, rpm:requires, .
void tag (const Tag tag)
 Appends tag to _tagpath.
bool isBeingProcessed (Tag tag) const
 Check whether we are currently processing given tag.
void toParentTag ()
 Move to parent tag in the _tagpath.
const TagPathtagPath () const
 Getter of the tagpath object.

Private Attributes

TagPath _tagpath
 Used to remember the tag beeing currently processed.
bool _expect_rpm_entry
 Used to remember whether we are expecting an rpm:entry tag e.g.
Dep _dtype
 Type of dependecy beeing processed.

Classes

struct  TagPath
 Lightweight object for remembering currently processed tag. More...


Detailed Description

Definition at line 28 of file FileReaderBaseImpl.h.


Member Enumeration Documentation

enum zypp::parser::yum::FileReaderBase::BaseImpl::Tag

Enumeration of some YUM metadata xml tags.

Enumerator:
tag_NONE 
tag_package 
tag_format 
tag_patch 
tag_atoms 
tag_script 
tag_message 
tag_pkgfiles 
tag_deltarpm 
tag_patchrpm 
tag_pattern 
tag_product 

Definition at line 35 of file FileReaderBaseImpl.h.


Constructor & Destructor Documentation

zypp::parser::yum::FileReaderBase::BaseImpl::BaseImpl (  ) 

CTOR.

Definition at line 35 of file FileReaderBaseImpl.cc.


Member Function Documentation

bool zypp::parser::yum::FileReaderBase::BaseImpl::consumePackageNode ( xml::Reader reader_r,
data::Packagebase_Ptr &  package_ptr 
)

Process package node and its subtree.

This method can be extended for specific implementations.

Parameters:
reader_r 
package_ptr This can be either data::Package or data::SrcPackage.
Returns:
true if the package node or current subnode has been consumed (no further processing is required), false otherwise.
Exceptions:
ParseException if a serious error is encountered while parsing

Todo:
what's 'archive' size of the package (it is neither the rpm file size nor its installed size)

Definition at line 52 of file FileReaderBaseImpl.cc.

References zypp::xml::XmlString::asString(), consumeFormatNode(), isBeingProcessed(), zypp::xml::Reader::nodeText(), tag(), tag_format, tag_package, and ZYPP_THROW.

Referenced by zypp::parser::yum::PrimaryFileReader::Impl::consumeNode(), and zypp::parser::yum::PatchFileReader::Impl::consumePackageNode().

bool zypp::parser::yum::FileReaderBase::BaseImpl::consumeFormatNode ( xml::Reader reader_r,
data::Packagebase_Ptr &  package_ptr 
)

Function for processing all format tag subtree nodes.

Returns:
true if the package node or current subnode has been consumed (no further processing is required), false otherwise.

Todo:
xpath: //format/rpm:sourcerpm where to store this?

Todo:
xpath: //format/rpm:header-range what is this?

Todo:
xpath: //format/suse:dirsizes (?)

Todo:
this is ambiguous - fix the rnc schema

Definition at line 194 of file FileReaderBaseImpl.cc.

References zypp::xml::XmlString::asString(), consumeDependency(), zypp::xml::Reader::nodeText(), zypp::capability::parse(), zypp::Dep::PROVIDES, and toParentTag().

Referenced by consumePackageNode().

bool zypp::parser::yum::FileReaderBase::BaseImpl::consumeDependency ( xml::Reader reader_r,
data::Dependencies deps_r 
)

Processes RPM dependency tags (rpm:entry, rpm:requires, .

..).

Returns:
true if a dependency tag has been encountered, false otherwise.
Exceptions:
ParseException if a serious error is encountered while parsing

Todo:
check <rpm:entry name="/bin/sh" pre="1">

Definition at line 312 of file FileReaderBaseImpl.cc.

References _dtype, _expect_rpm_entry, zypp::Dep::CONFLICTS, zypp::Dep::ENHANCES, zypp::Dep::FRESHENS, zypp::Dep::inSwitch(), zypp::Dep::OBSOLETES, zypp::capability::parse(), zypp::Dep::PREREQUIRES, zypp::Dep::PROVIDES, zypp::Dep::RECOMMENDS, zypp::Dep::REQUIRES, zypp::Dep::REQUIRES_e, zypp::Dep::SUGGESTS, zypp::Dep::SUPPLEMENTS, and ZYPP_THROW.

Referenced by consumeFormatNode(), zypp::parser::yum::PatchFileReader::Impl::consumeMessageNode(), zypp::parser::yum::PatchFileReader::Impl::consumeNode(), zypp::parser::yum::PatternFileReader::Impl::consumeNode(), and zypp::parser::yum::PatchFileReader::Impl::consumeScriptNode().

void zypp::parser::yum::FileReaderBase::BaseImpl::tag ( const Tag  tag  )  [inline]

Appends tag to _tagpath.

Definition at line 125 of file FileReaderBaseImpl.h.

References _tagpath, and zypp::parser::yum::FileReaderBase::BaseImpl::TagPath::append().

Referenced by zypp::parser::yum::PatchFileReader::Impl::consumeAtomsNode(), zypp::parser::yum::PrimaryFileReader::Impl::consumeNode(), zypp::parser::yum::PatchFileReader::Impl::consumeNode(), zypp::parser::yum::PatternFileReader::Impl::consumeNode(), zypp::parser::yum::PatchFileReader::Impl::consumePackageNode(), and consumePackageNode().

bool zypp::parser::yum::FileReaderBase::BaseImpl::isBeingProcessed ( Tag  tag  )  const [inline]

Check whether we are currently processing given tag.

Definition at line 128 of file FileReaderBaseImpl.h.

References _tagpath, and zypp::parser::yum::FileReaderBase::BaseImpl::TagPath::contains().

Referenced by zypp::parser::yum::PatchFileReader::Impl::consumeAtomsNode(), zypp::parser::yum::PrimaryFileReader::Impl::consumeNode(), zypp::parser::yum::PatchFileReader::Impl::consumeNode(), zypp::parser::yum::PatchFileReader::Impl::consumePackageNode(), and consumePackageNode().

void zypp::parser::yum::FileReaderBase::BaseImpl::toParentTag (  )  [inline]

Move to parent tag in the _tagpath.

Definition at line 131 of file FileReaderBaseImpl.h.

References _tagpath, and zypp::parser::yum::FileReaderBase::BaseImpl::TagPath::remove().

Referenced by zypp::parser::yum::PatchFileReader::Impl::consumeAtomsNode(), consumeFormatNode(), zypp::parser::yum::PrimaryFileReader::Impl::consumeNode(), zypp::parser::yum::PatchFileReader::Impl::consumeNode(), zypp::parser::yum::PatternFileReader::Impl::consumeNode(), and zypp::parser::yum::PatchFileReader::Impl::consumePackageNode().

const TagPath& zypp::parser::yum::FileReaderBase::BaseImpl::tagPath (  )  const [inline]

Getter of the tagpath object.

Definition at line 134 of file FileReaderBaseImpl.h.

References _tagpath.


Member Data Documentation

TagPath zypp::parser::yum::FileReaderBase::BaseImpl::_tagpath [private]

Used to remember the tag beeing currently processed.

Definition at line 139 of file FileReaderBaseImpl.h.

Referenced by isBeingProcessed(), tag(), tagPath(), and toParentTag().

bool zypp::parser::yum::FileReaderBase::BaseImpl::_expect_rpm_entry [private]

Used to remember whether we are expecting an rpm:entry tag e.g.

for rpm:requires

Definition at line 145 of file FileReaderBaseImpl.h.

Referenced by consumeDependency().

Dep zypp::parser::yum::FileReaderBase::BaseImpl::_dtype [private]

Type of dependecy beeing processed.

Definition at line 150 of file FileReaderBaseImpl.h.

Referenced by consumeDependency().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:24 2007 for libzypp by  doxygen 1.5.3