Pārlūkot izejas kodu

2010-06-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Renamed member variables.
	* src/Netrc.cc
	* src/Netrc.h
Tatsuhiro Tsujikawa 15 gadi atpakaļ
vecāks
revīzija
6f89b0287a
3 mainītis faili ar 30 papildinājumiem un 24 dzēšanām
  1. 6 0
      ChangeLog
  2. 4 4
      src/Netrc.cc
  3. 20 20
      src/Netrc.h

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2010-06-12  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Renamed member variables.
+	* src/Netrc.cc
+	* src/Netrc.h
+
 2010-06-12  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Renamed member variables.

+ 4 - 4
src/Netrc.cc

@@ -68,7 +68,7 @@ void Netrc::skipMacdef(std::ifstream& f) const
 
 void Netrc::parse(const std::string& path)
 {
-  authenticators.clear();
+  _authenticators.clear();
   std::ifstream f(path.c_str(), std::ios::binary);
   
   if(!f) {
@@ -146,7 +146,7 @@ void Netrc::parse(const std::string& path)
 void Netrc::storeAuthenticator(const SharedHandle<Authenticator>& authenticator)
 {
   if(!authenticator.isNull()) {
-    authenticators.push_back(authenticator);
+    _authenticators.push_back(authenticator);
   }
 }
 
@@ -167,9 +167,9 @@ Netrc::findAuthenticator(const std::string& hostname) const
 {
   SharedHandle<Authenticator> res;
   std::vector<SharedHandle<Authenticator> >::const_iterator itr =
-    std::find_if(authenticators.begin(), authenticators.end(),
+    std::find_if(_authenticators.begin(), _authenticators.end(),
                  AuthHostMatch(hostname));
-  if(itr != authenticators.end()) {
+  if(itr != _authenticators.end()) {
     res = *itr;
   }
   return res;

+ 20 - 20
src/Netrc.h

@@ -55,10 +55,10 @@ public:
 
 class Authenticator : public Authenticatable {
 private:
-  std::string machine;
-  std::string login;
-  std::string password;
-  std::string account;
+  std::string _machine;
+  std::string _login;
+  std::string _password;
+  std::string _account;
 public:
   Authenticator() {}
 
@@ -66,45 +66,45 @@ public:
                 const std::string& login,
                 const std::string& password,
                 const std::string& account)
-    :machine(machine),
-     login(login),
-     password(password),
-     account(account) {}
+    :_machine(machine),
+     _login(login),
+     _password(password),
+     _account(account) {}
 
   virtual ~Authenticator() {}
 
   virtual bool match(const std::string& hostname) const
   {
-    return hostname == machine;
+    return hostname == _machine;
   }
 
   const std::string& getMachine() const
   {
-    return machine;
+    return _machine;
   }
 
-  void setMachine(const std::string& machine) { this->machine = machine; }
+  void setMachine(const std::string& machine) { _machine = machine; }
 
   const std::string& getLogin() const
   {
-    return login;
+    return _login;
   }
 
-  void setLogin(const std::string& login) { this->login = login; }
+  void setLogin(const std::string& login) { _login = login; }
 
   const std::string& getPassword() const
   {
-    return password;
+    return _password;
   }
 
-  void setPassword(const std::string& password) { this->password = password; }
+  void setPassword(const std::string& password) { _password = password; }
 
   const std::string& getAccount() const
   {
-    return account;
+    return _account;
   }
 
-  void setAccount(const std::string& account) { this->account = account; }
+  void setAccount(const std::string& account) { _account = account; }
 };
 
 class DefaultAuthenticator : public Authenticator {
@@ -126,7 +126,7 @@ public:
 
 class Netrc {
 private:
-  std::vector<SharedHandle<Authenticator> > authenticators;
+  std::vector<SharedHandle<Authenticator> > _authenticators;
 
   void storeAuthenticator(const SharedHandle<Authenticator>& authenticator);
 
@@ -143,12 +143,12 @@ public:
 
   const std::vector<SharedHandle<Authenticator> >& getAuthenticators() const
   {
-    return authenticators;
+    return _authenticators;
   }
 
   void addAuthenticator(const SharedHandle<Authenticator>& authenticator)
   {
-    authenticators.push_back(authenticator);
+    _authenticators.push_back(authenticator);
   }
 
   static const std::string MACHINE;