From 96f23534c3a37e9ebea00ac6eb24fbf8bf4a919c Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Fri, 13 Apr 2012 20:44:11 -0700 Subject: [PATCH] Add const to some ParseSection functions. --- src/ParseSection.cpp | 4 ++-- src/ParseSection.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ParseSection.cpp b/src/ParseSection.cpp index 2258da1db..3fe6efbc3 100644 --- a/src/ParseSection.cpp +++ b/src/ParseSection.cpp @@ -69,7 +69,7 @@ void PrintSection(section secInput) std::cerr << "PrintSection<" << std::endl; } -section::mapped_type* sectionEntries(section& secSource, std::string strSection) +section::mapped_type* sectionEntries(section& secSource, const std::string strSection) { section::iterator it; section::mapped_type* smtResult; @@ -96,7 +96,7 @@ int sectionCount(section& secSource, std::string strSection) return pmtEntries ? -1 : pmtEntries->size(); } -bool sectionSingleB(section& secSource, std::string strSection, std::string& strValue) +bool sectionSingleB(section& secSource, const std::string strSection, std::string& strValue) { section::mapped_type* pmtEntries = sectionEntries(secSource, strSection); bool bSingle = pmtEntries && 1 == pmtEntries->size(); diff --git a/src/ParseSection.h b/src/ParseSection.h index 1f7a4aa7c..027f29f26 100644 --- a/src/ParseSection.h +++ b/src/ParseSection.h @@ -9,8 +9,8 @@ typedef std::map > section; section ParseSection(const std::string strInput, const bool bTrim); void PrintSection(section secInput); -bool sectionSingleB(section& secSource, std::string strSection, std::string& strValue); +bool sectionSingleB(section& secSource, const std::string strSection, std::string& strValue); int sectionCount(section& secSource, std::string strSection); -section::mapped_type* sectionEntries(section& secSource, std::string strSection); +section::mapped_type* sectionEntries(section& secSource, const std::string strSection); #endif