Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / protocols / ace / INet / HTTP_BasicAuthentication.h
blob0c756e94eca500e848b5e40cee581fd4d9f21df8
1 /**
2 * @file HTTP_BasicAuthentication.h
4 * @author Martin Corino <mcorino@remedy.nl>
5 */
7 #ifndef ACE_HTTP_BASIC_AUTHENTICATION_H
8 #define ACE_HTTP_BASIC_AUTHENTICATION_H
10 #include /**/ "ace/pre.h"
12 #include /**/ "ace/config-all.h"
14 #if !defined (ACE_LACKS_PRAGMA_ONCE)
15 # pragma once
16 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 #include "ace/INet/INet_Export.h"
19 #include "ace/INet/HTTP_Request.h"
21 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
23 namespace ACE
25 namespace HTTP
27 /**
28 * @class ACE_HTTP_BasicAuthentication
30 * @brief Provides support for HTTP Basic Authentication credentials.
33 class ACE_INET_Export BasicAuthentication
35 public:
36 /// Constructor
37 BasicAuthentication();
39 /// Constructor. Sets user id and password.
40 BasicAuthentication(const ACE_CString& user, const ACE_CString& passwd);
42 /// Constructor. Decodes cedentials from request (if any).
43 BasicAuthentication(const Request& request);
45 /// Destructor
46 virtual ~BasicAuthentication();
48 /// Set user id.
49 void user (const ACE_CString& user);
51 /// Get user id.
52 const ACE_CString& user () const;
54 /// Set password.
55 void password (const ACE_CString& passwd);
57 /// Get password.
58 const ACE_CString& password () const;
60 /// Add authentication header with encoded credentials to request.
61 void set_credentials (Request& request) const;
63 static const char* SCHEME;
65 private:
66 // prevent copying
67 BasicAuthentication(const BasicAuthentication&);
68 BasicAuthentication& operator =(BasicAuthentication&);
70 ACE_CString user_;
71 ACE_CString passwd_;
76 ACE_END_VERSIONED_NAMESPACE_DECL
78 #if defined (__ACE_INLINE__)
79 #include "ace/INet/HTTP_BasicAuthentication.inl"
80 #endif
82 #include /**/ "ace/post.h"
83 #endif /* ACE_HTTP_BASIC_AUTHENTICATION_H */