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

Renamed member variables.
	* src/Option.cc
	* src/Option.h
pull/1/head
Tatsuhiro Tsujikawa 2010-06-12 10:09:43 +00:00
parent 6f89b0287a
commit 26faa70b3b
3 changed files with 19 additions and 13 deletions

View File

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

View File

@ -45,23 +45,23 @@ Option::Option() {}
Option::~Option() {} Option::~Option() {}
void Option::put(const std::string& name, const std::string& value) { void Option::put(const std::string& name, const std::string& value) {
table[name] = value; _table[name] = value;
} }
bool Option::defined(const std::string& name) const bool Option::defined(const std::string& name) const
{ {
return table.count(name) == 1; return _table.count(name) == 1;
} }
bool Option::blank(const std::string& name) const bool Option::blank(const std::string& name) const
{ {
std::map<std::string, std::string>::const_iterator i = table.find(name); std::map<std::string, std::string>::const_iterator i = _table.find(name);
return i == table.end() || (*i).second.empty(); return i == _table.end() || (*i).second.empty();
} }
const std::string& Option::get(const std::string& name) const { const std::string& Option::get(const std::string& name) const {
std::map<std::string, std::string>::const_iterator itr = table.find(name); std::map<std::string, std::string>::const_iterator itr = _table.find(name);
if(itr == table.end()) { if(itr == _table.end()) {
return A2STR::NIL; return A2STR::NIL;
} else { } else {
return (*itr).second; return (*itr).second;
@ -101,15 +101,15 @@ double Option::getAsDouble(const std::string& name) const {
void Option::remove(const std::string& name) void Option::remove(const std::string& name)
{ {
std::map<std::string, std::string>::iterator i = table.find(name); std::map<std::string, std::string>::iterator i = _table.find(name);
if(i != table.end()) { if(i != _table.end()) {
table.erase(i); _table.erase(i);
} }
} }
void Option::clear() void Option::clear()
{ {
table.clear(); _table.clear();
} }
} // namespace aria2 } // namespace aria2

View File

@ -43,7 +43,7 @@ namespace aria2 {
class Option { class Option {
private: private:
std::map<std::string, std::string> table; std::map<std::string, std::string> _table;
public: public:
Option(); Option();
~Option(); ~Option();
@ -67,12 +67,12 @@ public:
std::map<std::string, std::string>::const_iterator begin() const std::map<std::string, std::string>::const_iterator begin() const
{ {
return table.begin(); return _table.begin();
} }
std::map<std::string, std::string>::const_iterator end() const std::map<std::string, std::string>::const_iterator end() const
{ {
return table.end(); return _table.end();
} }
}; };