summaryrefslogtreecommitdiff
path: root/base/inifile.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-11-02 21:49:15 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-11-02 21:49:15 -0800
commit2ac054386d9394689e728241972dab7184ae965d (patch)
treea9f5402c71efb356e4b601b727e4dd78d39cbbfa /base/inifile.cc
parent34c8821970e0302338a370c06c03ad8c3a0c7996 (diff)
downloadgem5-2ac054386d9394689e728241972dab7184ae965d.tar.xz
Print a warning rather than failing if we're unserializing and there's an
object in the config that was not in the checkpointed config. This code compiles, but I haven't tested it... I'm committing it so Ron can have it. Should not effect anything that currently works. base/inifile.cc: base/inifile.hh: Add sectionExists() method so you can query whether a section exists without knowing any of the entry names that would be in it. sim/serialize.cc: sim/serialize.hh: Add Checkpoint::sectionExists() (pass through to IniFile). --HG-- extra : convert_revision : 905db122afdfe55946ab8493ccac0b1e715bc7c6
Diffstat (limited to 'base/inifile.cc')
-rw-r--r--base/inifile.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/inifile.cc b/base/inifile.cc
index 7e7485bcb..2717a534d 100644
--- a/base/inifile.cc
+++ b/base/inifile.cc
@@ -402,6 +402,14 @@ IniFile::findAppend(const string &_section, const string &entry,
return ret;
}
+
+bool
+IniFile::sectionExists(const string &sectionName) const
+{
+ return findSection(sectionName) != NULL;
+}
+
+
bool
IniFile::Section::printUnreferenced(const string &sectionName)
{