From: ThorstenB Date: Wed, 10 Oct 2012 19:31:57 +0000 (+0200) Subject: Move uppercase function to strutils. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1ff3a61de65e39baeec17100a52532eacc05ba54;p=simgear.git Move uppercase function to strutils. --- diff --git a/simgear/misc/strutils.cxx b/simgear/misc/strutils.cxx index b1f74318..8c4accf6 100644 --- a/simgear/misc/strutils.cxx +++ b/simgear/misc/strutils.cxx @@ -292,6 +292,14 @@ namespace simgear { return result; } + string uppercase(const string &s) { + string rslt(s); + for(string::iterator p = rslt.begin(); p != rslt.end(); p++){ + *p = toupper(*p); + } + return rslt; + } + } // end namespace strutils } // end namespace simgear diff --git a/simgear/misc/strutils.hxx b/simgear/misc/strutils.hxx index 9bd1dbe1..f5362073 100644 --- a/simgear/misc/strutils.hxx +++ b/simgear/misc/strutils.hxx @@ -142,6 +142,13 @@ namespace simgear { * is greater */ int compare_versions(const std::string& v1, const std::string& v2); + + /** + * Convert a string to upper case. + * @return upper case string + */ + std::string uppercase(const std::string &s); + } // end namespace strutils } // end namespace simgear