-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLogon.hpp
72 lines (55 loc) · 1.62 KB
/
Logon.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
////////////////////////////////////////////////////////////////////////////////
//! \file Logon.hpp
//! \brief The Logon class declaration.
//! \author Chris Oldwood
// Check for previous inclusion
#ifndef APP_LOGON_HPP
#define APP_LOGON_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include <Core/SharedPtr.hpp>
////////////////////////////////////////////////////////////////////////////////
//! The custom credentials to use for querying a host.
class Logon
{
public:
//! Default constructor.
Logon();
//! Constructor.
Logon(const tstring& user, const tstring& password);
//
// Members.
//
tstring m_user; //!< The user name.
tstring m_password; //!< The password.
};
//! The default Logon const smart pointer type.
typedef Core::SharedPtr<const Logon> ConstLogonPtr;
////////////////////////////////////////////////////////////////////////////////
//! Default constructor.
inline Logon::Logon()
: m_user()
, m_password()
{
}
////////////////////////////////////////////////////////////////////////////////
//! Constructor.
inline Logon::Logon(const tstring& user, const tstring& password)
: m_user(user)
, m_password(password)
{
}
////////////////////////////////////////////////////////////////////////////////
//! Create a new logon.
inline ConstLogonPtr makeLogon(const tstring& user, const tstring& password)
{
return ConstLogonPtr(new Logon(user, password));
}
////////////////////////////////////////////////////////////////////////////////
//! Create a new logon.
inline ConstLogonPtr makeLogon(const Logon& logon)
{
return ConstLogonPtr(new Logon(logon.m_user, logon.m_password));
}
#endif // APP_LOGON_HPP