summaryrefslogtreecommitdiff
path: root/src/NetrcAuthResolver.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-02-08 15:53:45 +0000
commit1b7c1982896dba1d38e1fe84ba9660996607f5f9 (patch)
treed12047cb37ded1e18d4d5b97844412538beb19ff /src/NetrcAuthResolver.cc
parentd82e183d346375ac8a58a298a58728be615f947e (diff)
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
Diffstat (limited to 'src/NetrcAuthResolver.cc')
-rw-r--r--src/NetrcAuthResolver.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/NetrcAuthResolver.cc b/src/NetrcAuthResolver.cc
index c055a88f..d1c1af13 100644
--- a/src/NetrcAuthResolver.cc
+++ b/src/NetrcAuthResolver.cc
@@ -33,8 +33,12 @@
*/
/* copyright --> */
#include "NetrcAuthResolver.h"
+#include "AuthConfig.h"
+#include "Netrc.h"
-AuthConfigHandle NetrcAuthResolver::resolveAuthConfig(const string& hostname)
+namespace aria2 {
+
+AuthConfigHandle NetrcAuthResolver::resolveAuthConfig(const std::string& hostname)
{
if(_userDefinedAuthConfig.isNull()) {
return findNetrcAuthenticator(hostname);
@@ -43,7 +47,7 @@ AuthConfigHandle NetrcAuthResolver::resolveAuthConfig(const string& hostname)
}
}
-AuthConfigHandle NetrcAuthResolver::findNetrcAuthenticator(const string& hostname) const
+AuthConfigHandle NetrcAuthResolver::findNetrcAuthenticator(const std::string& hostname) const
{
if(_netrc.isNull()) {
return _defaultAuthConfig;
@@ -56,3 +60,15 @@ AuthConfigHandle NetrcAuthResolver::findNetrcAuthenticator(const string& hostnam
}
}
}
+
+void NetrcAuthResolver::setNetrc(const NetrcHandle& netrc)
+{
+ _netrc = netrc;
+}
+
+NetrcHandle NetrcAuthResolver::getNetrc() const
+{
+ return _netrc;
+}
+
+} // namespace aria2