[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src config.cpp config.hpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src config.cpp config.hpp |
Date: |
Wed, 23 Mar 2005 03:23:05 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 05/03/23 08:23:05
Modified files:
src : config.cpp config.hpp
Log message:
Move helper struct out of the way.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/config.cpp.diff?tr1=1.132&tr2=1.133&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/config.hpp.diff?tr1=1.58&tr2=1.59&r1=text&r2=text
Patches:
Index: wesnoth/src/config.cpp
diff -u wesnoth/src/config.cpp:1.132 wesnoth/src/config.cpp:1.133
--- wesnoth/src/config.cpp:1.132 Mon Mar 14 21:07:36 2005
+++ wesnoth/src/config.cpp Wed Mar 23 08:23:05 2005
@@ -1,4 +1,4 @@
-/* $Id: config.cpp,v 1.132 2005/03/14 21:07:36 gruikya Exp $ */
+/* $Id: config.cpp,v 1.133 2005/03/23 08:23:05 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -158,6 +158,8 @@
return *v[index];
}
+namespace {
+
struct remove_ordered {
remove_ordered(const std::string& key) : key_(key) {}
@@ -166,6 +168,8 @@
std::string key_;
};
+}
+
void config::clear_children(const std::string& key)
{
ordered_children.erase(std::remove_if(ordered_children.begin(),ordered_children.end(),remove_ordered(key)),ordered_children.end());
@@ -226,6 +230,21 @@
}
}
+namespace {
+
+struct config_has_value {
+ config_has_value(const std::string& name, const std::string& value)
+ : name_(name), value_(value)
+ {}
+
+ bool operator()(const config* cfg) const { return (*cfg)[name_] ==
value_; }
+
+private:
+ const std::string name_, value_;
+};
+
+}
+
config* config::find_child(const std::string& key,
const std::string& name,
const std::string& value)
Index: wesnoth/src/config.hpp
diff -u wesnoth/src/config.hpp:1.58 wesnoth/src/config.hpp:1.59
--- wesnoth/src/config.hpp:1.58 Sat Mar 5 10:54:25 2005
+++ wesnoth/src/config.hpp Wed Mar 23 08:23:05 2005
@@ -1,4 +1,4 @@
-/* $Id: config.hpp,v 1.58 2005/03/05 10:54:25 silene Exp $ */
+/* $Id: config.hpp,v 1.59 2005/03/23 08:23:05 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -134,15 +134,4 @@
bool operator==(const config& a, const config& b);
bool operator!=(const config& a, const config& b);
-struct config_has_value {
- config_has_value(const std::string& name, const std::string& value)
- : name_(name), value_(value)
- {}
-
- bool operator()(const config* cfg) const { return (*cfg)[name_] ==
value_; }
-
-private:
- const std::string name_, value_;
-};
-
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src config.cpp config.hpp,
Guillaume Melquiond <=