From 4f76de82c55e55cdaba1ddec85eb0d016b544633 Mon Sep 17 00:00:00 2001 From: Chuck Miller Date: Wed, 6 Jan 2010 20:43:18 -0500 Subject: Fixes so mapreader ignores the case of object types This will decrease warnings in the log file by a good bit --- src/utils/stringutils.cpp | 6 ++++++ src/utils/stringutils.h | 9 +++++++++ 2 files changed, 15 insertions(+) (limited to 'src/utils') diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index adcedaa1..67a0d831 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -50,6 +50,12 @@ std::string &toLower(std::string &str) return str; } +std::string &toUpper(std::string &str) +{ + std::transform(str.begin(), str.end(), str.begin(), toupper); + return str; +} + unsigned int atox(const std::string &str) { unsigned int value; diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index c5757d0f..51144a8a 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -41,6 +41,15 @@ std::string &trim(std::string &str); */ std::string &toLower(std::string &str); +/** + * Converts the given strong to upper case. + * + * @param str the string to convert to upper case + * @return a reference to the given string converted to upper case + */ +std::string &toUpper(std::string &str); + + /** * Converts an ascii hexidecimal string to an integer * -- cgit v1.2.3-70-g09d2