libzypp 17.37.17
authdata.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MEDIA_AUTH_DATA_H
13#define ZYPP_MEDIA_AUTH_DATA_H
14
15#include <zypp-core/Url.h>
17
18#include <utility>
19
20namespace zypp {
21 namespace media {
22
24
25
31{
32public:
34 {}
35
36 AuthData(const Url & url);
37
38 AuthData(std::string username, std::string password)
40 {}
41
42 virtual ~AuthData() {};
43
49 virtual bool valid() const;
50
51 void setUrl(const Url & url) { _url = url; }
52 void setUsername(const std::string & username) { _username = username; }
53 void setPassword(const std::string & password) { _password = password; }
54
55 Url url() const { return _url; }
56 std::string username() const { return _username; }
57 std::string password() const { return _password; }
58
63 time_t lastDatabaseUpdate () const;
64 void setLastDatabaseUpdate ( time_t time );
65
66 const std::map<std::string, std::string> &extraValues() const;
67 std::map<std::string, std::string> &extraValues();
68
69 virtual std::ostream & dumpOn( std::ostream & str ) const;
70
71 virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
72
73private:
75 std::string _username;
76 std::string _password;
77 time_t _lastChange; //< timestamp of the last change to the database this credential is stored in
78 std::map<std::string, std::string> _extraValues;
79};
80
82std::ostream & operator << (std::ostream & str, const AuthData & auth_data);
83
85
86 } // namespace media
87} // namespace zypp
88
89#endif // ZYPP_MEDIA_AUTH_DATA_H
Url manipulation class.
Definition Url.h:93
Class for handling media authentication data.
Definition authdata.h:31
AuthData(std::string username, std::string password)
Definition authdata.h:38
std::string password() const
Definition authdata.h:57
void setUsername(const std::string &username)
Definition authdata.h:52
Url url() const
Definition authdata.h:55
void setPassword(const std::string &password)
Definition authdata.h:53
virtual ~AuthData()
Definition authdata.h:42
std::map< std::string, std::string > _extraValues
Definition authdata.h:78
void setUrl(const Url &url)
Definition authdata.h:51
std::string _username
Definition authdata.h:75
std::string username() const
Definition authdata.h:56
std::string _password
Definition authdata.h:76
Definition Arch.h:364
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const MediaHandler &obj)
shared_ptr< AuthData > AuthData_Ptr
Definition authdata.h:81
Url details namespace.
Definition UrlBase.cc:58
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247