浏览代码

2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Added remove().
	* src/Option.cc
	* src/Option.h
Tatsuhiro Tsujikawa 16 年之前
父节点
当前提交
12145ef4c6
共有 3 个文件被更改,包括 16 次插入0 次删除
  1. 6 0
      ChangeLog
  2. 8 0
      src/Option.cc
  3. 2 0
      src/Option.h

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2009-11-28  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Added remove().
+	* src/Option.cc
+	* src/Option.h
+
 2009-11-28  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Removed options which is only valid for URIs specified in

+ 8 - 0
src/Option.cc

@@ -99,6 +99,14 @@ double Option::getAsDouble(const std::string& name) const {
   }
 }
 
+void Option::remove(const std::string& name)
+{
+  std::map<std::string, std::string>::iterator i = table.find(name);
+  if(i != table.end()) {
+    table.erase(i);
+  }
+}
+
 void Option::clear()
 {
   table.clear();

+ 2 - 0
src/Option.h

@@ -61,6 +61,8 @@ public:
   bool getAsBool(const std::string& name) const;
   double getAsDouble(const std::string& name) const;
   
+  void remove(const std::string& name);
+
   void clear();
 };