libnick 2024.9.2
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
credential.h
Go to the documentation of this file.
1
23#ifndef CREDENTIAL_H
24#define CREDENTIAL_H
25
26#include <iostream>
27#include <string>
28
30{
35 {
36 public:
44 Credential(const std::string& name, const std::string& uri, const std::string& username, const std::string& password);
49 const std::string& getName() const;
54 void setName(const std::string& name);
59 const std::string& getUri() const;
64 void setUri(const std::string& uri);
69 const std::string& getUsername() const;
74 void setUsername(const std::string& username);
79 const std::string& getPassword() const;
84 void setPassword(const std::string& password);
90 bool operator<(const Credential& compare) const;
96 bool operator>(const Credential& compare) const;
102 bool operator==(const Credential& compare) const;
108 bool operator!=(const Credential& compare) const;
112 friend std::ostream& operator<<(std::ostream& os, const Credential& credential);
113
114 private:
115 std::string m_name;
116 std::string m_uri;
117 std::string m_username;
118 std::string m_password;
119 };
120}
121
122#endif //CREDENTIAL_H
A model of a credential stored in a keyring.
Definition credential.h:35
void setUsername(const std::string &username)
Sets the username of the credential.
bool operator<(const Credential &compare) const
Compares Credential objects via < operator.
const std::string & getName() const
Gets the name of the credential.
bool operator>(const Credential &compare) const
Compares Credential objects via > operator.
void setPassword(const std::string &password)
Sets the password of the credential.
bool operator!=(const Credential &compare) const
Compares Credential objects via != operator.
Credential(const std::string &name, const std::string &uri, const std::string &username, const std::string &password)
Constructs a credential.
void setName(const std::string &name)
Sets the name of the credential.
const std::string & getUsername() const
Gets the username of the credential.
bool operator==(const Credential &compare) const
Compares Credential objects via == operator.
void setUri(const std::string &uri)
Sets the uri of the credential (can also be used as a comment for the Credential)
const std::string & getPassword() const
Gets the password of the credential.
friend std::ostream & operator<<(std::ostream &os, const Credential &credential)
Outputs the Credential object.
const std::string & getUri() const
Gets the uri of the credential (can also be used as a comment for the Credential)
Definition credential.h:30