libzypp  13.10.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
MediaPriority & operator=(value_type rhs)
Assign.
Definition: MediaPriority.h:67
MediaPriority & operator=(const Url &url_r)
Assign priority of scheme string defined by Url.
Definition: MediaPriority.h:75
MediaPriority()
Default ctor.
Definition: MediaPriority.h:50
MediaPriority & operator=(const std::string &scheme_r)
Assign priority of scheme string.
Definition: MediaPriority.h:71
MediaPriority(value_type val_r)
Copy ctor.
Definition: MediaPriority.h:55
Derive a numeric priority from Url scheme according to zypp.conf(download.media_preference).
Definition: MediaPriority.h:43
Url manipulation class.
Definition: Url.h:87