Add const to some ParseSection functions.

This commit is contained in:
Arthur Britto
2012-04-13 20:44:11 -07:00
parent 12349122e5
commit 96f23534c3
2 changed files with 4 additions and 4 deletions

View File

@@ -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();

View File

@@ -9,8 +9,8 @@ typedef std::map<const std::string, std::vector<std::string> > 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