[Scummvm-git-logs] scummvm master -> 207810dd601cb70a4754ee2159b7aeba784c92c2

OMGPizzaGuy noreply at scummvm.org
Sat Dec 30 05:04:57 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
207810dd60 ULTIMA8: Add const to ConfigFileManager methods


Commit: 207810dd601cb70a4754ee2159b7aeba784c92c2
    https://github.com/scummvm/scummvm/commit/207810dd601cb70a4754ee2159b7aeba784c92c2
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-12-29T23:04:29-06:00

Commit Message:
ULTIMA8: Add const to ConfigFileManager methods

Changed paths:
    engines/ultima/ultima8/conf/config_file_manager.cpp
    engines/ultima/ultima8/conf/config_file_manager.h


diff --git a/engines/ultima/ultima8/conf/config_file_manager.cpp b/engines/ultima/ultima8/conf/config_file_manager.cpp
index 35c968dee0a..66107c1bf43 100644
--- a/engines/ultima/ultima8/conf/config_file_manager.cpp
+++ b/engines/ultima/ultima8/conf/config_file_manager.cpp
@@ -83,8 +83,8 @@ void ConfigFileManager::clearRoot(const Std::string &category) {
 	}
 }
 
-bool ConfigFileManager::get(const Std::string &category, const Std::string &section, const Std::string &key, string &ret) {
-	Std::vector<ConfigFile*>::reverse_iterator i;
+bool ConfigFileManager::get(const Std::string &category, const Std::string &section, const Std::string &key, string &ret) const {
+	Std::vector<ConfigFile*>::const_reverse_iterator i;
 	for (i = _configFiles.rbegin(); i != _configFiles.rend(); ++i) {
 		if (category.equalsIgnoreCase((*i)->_category)) {
 			if ((*i)->_iniFile.getKey(key, section, ret)) {
@@ -97,7 +97,7 @@ bool ConfigFileManager::get(const Std::string &category, const Std::string &sect
 }
 
 
-bool ConfigFileManager::get(const Std::string &category, const Std::string &section, const Std::string &key, int &ret) {
+bool ConfigFileManager::get(const Std::string &category, const Std::string &section, const Std::string &key, int &ret) const {
 	string stringval;
 	if (!get(category, section, key, stringval))
 		return false;
@@ -106,7 +106,7 @@ bool ConfigFileManager::get(const Std::string &category, const Std::string &sect
 	return true;
 }
 
-bool ConfigFileManager::get(const Std::string &category, const Std::string &section, const Std::string &key, bool &ret) {
+bool ConfigFileManager::get(const Std::string &category, const Std::string &section, const Std::string &key, bool &ret) const {
 	string stringval;
 	if (!get(category, section, key, stringval))
 		return false;
@@ -115,7 +115,7 @@ bool ConfigFileManager::get(const Std::string &category, const Std::string &sect
 	return true;
 }
 
-Std::vector<Std::string> ConfigFileManager::listSections(const Std::string &category) {
+Std::vector<Std::string> ConfigFileManager::listSections(const Std::string &category) const {
 	Std::vector<Std::string> sections;
 	Std::vector<ConfigFile*>::const_iterator i;
 
@@ -132,7 +132,7 @@ Std::vector<Std::string> ConfigFileManager::listSections(const Std::string &cate
 	return sections;
 }
 
-KeyMap ConfigFileManager::listKeyValues(const Std::string &category, const Std::string &section) {
+KeyMap ConfigFileManager::listKeyValues(const Std::string &category, const Std::string &section) const {
 	KeyMap values;
 	Std::vector<ConfigFile*>::const_iterator i;
 
diff --git a/engines/ultima/ultima8/conf/config_file_manager.h b/engines/ultima/ultima8/conf/config_file_manager.h
index d4030d7eb5d..8ca3347fb97 100644
--- a/engines/ultima/ultima8/conf/config_file_manager.h
+++ b/engines/ultima/ultima8/conf/config_file_manager.h
@@ -59,21 +59,21 @@ public:
 	void clearRoot(const Std::string &category);
 
 	//! get value
-	bool get(const Std::string &category, const Std::string &section, const Std::string &key, Std::string &ret);
+	bool get(const Std::string &category, const Std::string &section, const Std::string &key, Std::string &ret) const;
 	//! get value
-	bool get(const Std::string &category, const Std::string &section, const Std::string &key, int &ret);
+	bool get(const Std::string &category, const Std::string &section, const Std::string &key, int &ret) const;
 	//! get value
-	bool get(const Std::string &category, const Std::string &section, const Std::string &key, bool &ret);
+	bool get(const Std::string &category, const Std::string &section, const Std::string &key, bool &ret) const;
 
 	//! list all sections
 	//! \param category The config category to list all sections in
 	//! \return the sections. They have no guaranteed order.
-	Std::vector<Std::string> listSections(const Std::string &category);
+	Std::vector<Std::string> listSections(const Std::string &category) const;
 	//! list all key-value pairs in the given section.
 	//! \param category The config category for the section to list
 	//! \param section The section to list
 	//! \return the key-value pairs. They have no guaranteed order.
-	KeyMap listKeyValues(const Std::string &category, const Std::string &section);
+	KeyMap listKeyValues(const Std::string &category, const Std::string &section) const;
 
 private:
 	Std::vector<ConfigFile *> _configFiles;




More information about the Scummvm-git-logs mailing list