/*
- * 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
#include "base/hashmap.hh"
-///
-/// @file
-/// Declaration of IniFile object.
-///
+/**
+ * @file
+ * Declaration of IniFile object.
+ * @todo Change comments to match documentation style.
+ */
///
/// This class represents the contents of a ".ini" file.
/// @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();
/// 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.
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.
- /// @retval True if found, false if not.
- bool findDefault(const std::string §ion, const std::string &entry,
- std::string &value) const;
-
- 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.