libzypp  17.28.0
SUSEMediaVerifier.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 
10 #ifndef ZYPP_SUSE_MEDIAVERIFIER_H
11 #define ZYPP_SUSE_MEDIAVERIFIER_H
12 
13 #include <iosfwd>
14 
17 #include <zypp/base/PtrTypes.h>
18 
19 namespace zypp
20 {
21  namespace repo
22  {
28  {
29  public:
34  explicit SUSEMediaVerifier( const Pathname & path_r, media::MediaNr mediaNr_r = 1 );
35 
40  SUSEMediaVerifier( const SUSEMediaVerifier & rhs, media::MediaNr mediaNr_r );
41 
43  ~SUSEMediaVerifier() override;
44 
45  public:
47  explicit operator bool() const
48  { return valid(); }
49 
51  bool valid() const;
52 
54  const std::string & vendor() const;
55 
57  const std::string & ident() const;
58 
60  media::MediaNr totalMedia() const;
61 
63  media::MediaNr mediaNr() const;
64 
65  public:
72  bool isDesiredMedia( const media::MediaHandler & ref_r ) const override;
73 
74  public:
75  class Impl;
76  friend std::ostream & operator<<( std::ostream & str, const SUSEMediaVerifier & obj );
77  private:
79  };
80 
82  //std::ostream & operator<<( std::ostream & str, const SUSEMediaVerifier & obj );
83 
84  } // namespace repo
85 } // namespace zypp
86 #endif
zypp::media::MediaNr
unsigned int MediaNr
Definition: MediaManager.h:30
zypp::repo::SUSEMediaVerifier
Implementation of the traditional SUSE media verifier.
Definition: SUSEMediaVerifier.h:28
zypp::repo::SUSEMediaVerifier::SUSEMediaVerifier
SUSEMediaVerifier(const Pathname &path_r, media::MediaNr mediaNr_r=1)
Ctor creating a verifier by parsing media file.
Definition: SUSEMediaVerifier.cc:125
zypp::repo::SUSEMediaVerifier::isDesiredMedia
bool isDesiredMedia(const media::MediaHandler &ref_r) const override
Check if \ref_r accesses the desired media.
Definition: SUSEMediaVerifier.cc:152
MediaHandler.h
zypp::repo::SUSEMediaVerifier::operator<<
friend std::ostream & operator<<(std::ostream &str, const SUSEMediaVerifier &obj)
Implementation class.
Definition: SUSEMediaVerifier.cc:199
zypp::media::MediaHandler
Abstract base class for 'physical' MediaHandler like MediaCD, etc.
Definition: MediaHandler.h:51
zypp::media::MediaVerifierBase
Interface to implement a media verifier.
Definition: MediaManager.h:48
zypp::repo::SUSEMediaVerifier::vendor
const std::string & vendor() const
Medias expected vendor string.
Definition: SUSEMediaVerifier.cc:139
MediaManager.h
bool
zypp::RW_pointer< Impl >
zypp::repo::SUSEMediaVerifier::mediaNr
media::MediaNr mediaNr() const
Media number expected by this verifier (starts with 1).
Definition: SUSEMediaVerifier.cc:148
zypp::repo::SUSEMediaVerifier::~SUSEMediaVerifier
~SUSEMediaVerifier() override
Dtor.
Definition: SUSEMediaVerifier.cc:133
zypp::repo::SUSEMediaVerifier::ident
const std::string & ident() const
Medias expected ident string.
Definition: SUSEMediaVerifier.cc:142
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::repo::SUSEMediaVerifier::totalMedia
media::MediaNr totalMedia() const
The total number of media in this set (or 0 if not known).
Definition: SUSEMediaVerifier.cc:145
Impl
zypp::repo::SUSEMediaVerifier::_pimpl
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: SUSEMediaVerifier.h:78
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
str
String related utilities and Regular expression matching.
zypp::repo::SUSEMediaVerifier::valid
bool valid() const
Data considered to be valid if we have vendor and ident.
Definition: SUSEMediaVerifier.cc:136