Commit 1b132491 authored by Matthieu Kermagoret's avatar Matthieu Kermagoret
Browse files

Connector SSH: restored credentials class.

parent 153d46be
......@@ -125,7 +125,7 @@ add_library("${CONNECTORLIB}"
"${SRC_DIR}/channel.cc"
"${SRC_DIR}/check_result.cc"
"${SRC_DIR}/commander.cc"
# "${SRC_DIR}/credentials.cc"
"${SRC_DIR}/credentials.cc"
"${SRC_DIR}/multiplexer.cc"
"${SRC_DIR}/session.cc"
# "${SRC_DIR}/sessions.cc"
......@@ -135,7 +135,7 @@ add_library("${CONNECTORLIB}"
"${INC_DIR}/channel.hh"
"${INC_DIR}/check_result.hh"
"${INC_DIR}/commander.hh"
# "${INC_DIR}/credentials.hh"
"${INC_DIR}/credentials.hh"
"${INC_DIR}/multiplexer.hh"
"${INC_DIR}/namespace.hh"
"${INC_DIR}/session.hh"
......
......@@ -18,13 +18,13 @@
** <http://www.gnu.org/licenses/>.
*/
#ifndef CCC_SSH_CREDENTIALS_HH_
# define CCC_SSH_CREDENTIALS_HH_
#ifndef CCCS_CREDENTIALS_HH
# define CCCS_CREDENTIALS_HH
# include <string>
# include "com/centreon/connector/ssh/namespace.hh"
# include <string>
# include "com/centreon/connector/ssh/namespace.hh"
CCC_SSH_BEGIN()
CCCS_BEGIN()
/**
* @class credentials credentials.hh "com/centreon/connector/ssh/credentials.hh"
......@@ -34,15 +34,10 @@ CCC_SSH_BEGIN()
* password. Methods are provided so that they can be compared.
*/
class credentials {
private:
std::string _host;
std::string _password;
std::string _user;
void _copy(credentials const& c);
public:
public:
credentials();
credentials(std::string const& host,
credentials(
std::string const& host,
std::string const& user,
std::string const& password);
credentials(credentials const& c);
......@@ -57,8 +52,15 @@ class credentials {
void set_host(std::string const& host);
void set_password(std::string const& password);
void set_user(std::string const& user);
private:
void _copy(credentials const& c);
std::string _host;
std::string _password;
std::string _user;
};
CCC_SSH_END()
CCCS_END()
#endif /* !CCC_SSH_CREDENTIALS_HH_ */
#endif // !CCCS_CREDENTIALS_HH
......@@ -22,24 +22,6 @@
using namespace com::centreon::connector::ssh;
/**************************************
* *
* Private Methods *
* *
**************************************/
/**
* Copy internal data members.
*
* @param[in] c Object to copy.
*/
void credentials::_copy(credentials const& c) {
_host = c._host;
_password = c._password;
_user = c._user;
return ;
}
/**************************************
* *
* Public Methods *
......@@ -60,9 +42,10 @@ credentials::credentials() {}
* @param[in] user User.
* @param[in] password Password.
*/
credentials::credentials(std::string const& host,
std::string const& user,
std::string const& password)
credentials::credentials(
std::string const& host,
std::string const& user,
std::string const& password)
: _host(host), _password(password), _user(user) {}
/**
......@@ -193,3 +176,21 @@ void credentials::set_user(std::string const& user) {
_user = user;
return ;
}
/**************************************
* *
* Private Methods *
* *
**************************************/
/**
* Copy internal data members.
*
* @param[in] c Object to copy.
*/
void credentials::_copy(credentials const& c) {
_host = c._host;
_password = c._password;
_user = c._user;
return ;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment