From 1ff3a61de65e39baeec17100a52532eacc05ba54 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Wed, 10 Oct 2012 21:31:57 +0200 Subject: [PATCH] Move uppercase function to strutils. --- simgear/misc/strutils.cxx | 8 ++++++++ simgear/misc/strutils.hxx | 7 +++++++ 2 files changed, 15 insertions(+) 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 -- 2.39.5