libzypp  17.23.6
MediaPriority.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_MEDIA_MEDIAPRIORITY_H
13 #define ZYPP_MEDIA_MEDIAPRIORITY_H
14 
15 #include <string>
16 
18 namespace zypp
19 {
20 
21  class Url;
22 
24  namespace media
25  {
26 
28  //
29  // CLASS NAME : MediaPriority
30  //
44  {
45  public:
46  typedef int value_type;
47 
48  public:
51  : _val( 0 )
52  {}
53 
56  : _val( val_r )
57  {}
58 
60  MediaPriority( const std::string & scheme_r );
61 
63  MediaPriority( const Url & url_r );
64 
65  public:
68  { _val = rhs; return *this; }
69 
71  MediaPriority & operator=( const std::string & scheme_r )
72  { _val = MediaPriority(scheme_r); return *this; }
73 
75  MediaPriority & operator=( const Url & url_r )
76  { _val = MediaPriority(url_r); return *this; }
77 
78  public:
82  value_type & get() { return _val; }
84  const value_type & get() const { return _val; }
86  operator value_type &() { return get(); }
88  operator const value_type &() const { return get(); }
90 
91  private:
93  };
94 
96  } // namespace media
99 } // namespace zypp
101 #endif // ZYPP_MEDIA_MEDIAPRIORITY_H
zypp::media::MediaPriority::value_type
int value_type
Definition: MediaPriority.h:46
zypp::media::MediaPriority::get
value_type & get()
Conversion to value_type.
Definition: MediaPriority.h:82
zypp::media::MediaPriority::_val
value_type _val
Definition: MediaPriority.h:92
zypp::media::MediaPriority
Derive a numeric priority from Url scheme according to zypp.conf(download.media_preference).
Definition: MediaPriority.h:43
zypp::media::MediaPriority::MediaPriority
MediaPriority()
Default ctor.
Definition: MediaPriority.h:50
zypp::media::MediaPriority::operator=
MediaPriority & operator=(const Url &url_r)
Assign priority of scheme string defined by Url.
Definition: MediaPriority.h:75
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::media::MediaPriority::operator=
MediaPriority & operator=(const std::string &scheme_r)
Assign priority of scheme string.
Definition: MediaPriority.h:71
zypp::media::MediaPriority::MediaPriority
MediaPriority(value_type val_r)
Copy ctor.
Definition: MediaPriority.h:55
zypp::media::MediaPriority::get
const value_type & get() const
Explicit.
Definition: MediaPriority.h:84
zypp::Url
Url manipulation class.
Definition: Url.h:87
zypp::media::MediaPriority::operator=
MediaPriority & operator=(value_type rhs)
Assign.
Definition: MediaPriority.h:67