X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=base%2Finifile.hh;h=d5d6bab5eb381a83a4baa57ae751b3ceaa16f92c;hb=3833533a64e5a6871ee8e1901c6dd1950d3966c4;hp=f67fdc7beb1a1611a2ab58c73a999065cf950601;hpb=71c11d063179e97529e6538fd790c5c28513a388;p=gem5.git diff --git a/base/inifile.hh b/base/inifile.hh index f67fdc7be..d5d6bab5e 100644 --- a/base/inifile.hh +++ b/base/inifile.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2003 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -151,12 +151,6 @@ class IniFile /// @retval Pointer to section object, or NULL if not found. Section *findSection(const std::string §ionName) const; - /// Load parameter settings from given istream. This is a helper - /// function for load(string) and loadCPP(), which open a file - /// and then pass it here. - /// @retval True if successful, false if errors were encountered. - bool load(std::istream &f); - public: /// Constructor. IniFile(); @@ -164,6 +158,12 @@ class IniFile /// Destructor. ~IniFile(); + /// Load parameter settings from given istream. This is a helper + /// function for load(string) and loadCPP(), which open a file + /// and then pass it here. + /// @retval True if successful, false if errors were encountered. + bool load(std::istream &f); + /// Load the specified file, passing it through the C preprocessor. /// Parameter settings found in the file will be merged with any /// already defined in this object. @@ -190,23 +190,12 @@ class IniFile bool find(const std::string §ion, const std::string &entry, std::string &value) const; - /// Find value corresponding to given section and entry names, - /// following "default" links to other sections where possible. - /// Value is returned by reference in 'value' param. - /// @return True if found, false if not. - bool findDefault(const std::string §ion, const std::string &entry, - std::string &value) const; - - /** - * Find a value corresponding to the given section and entry names - * following "append" links to other sections where possible. - * @param section The section to start with. - * @param entry The entry to find. - * @param value The value found. - * @return True if the entry was found. - */ - bool findAppend(const std::string §ion, const std::string &entry, - std::string &value) const; + /// Determine whether the named section exists in the .ini file. + /// Note that the 'Section' class is (intentionally) not public, + /// so all clients can do is get a bool that says whether there + /// are any values in that section or not. + /// @return True if the section exists. + bool sectionExists(const std::string §ion) const; /// Print unreferenced entries in object. Iteratively calls /// printUnreferend() on all the constituent sections.