summaryrefslogtreecommitdiff
path: root/odb/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-14 17:10:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-14 17:10:38 +0200
commit6280d3eed90b685e74c86b97b6636c29f868bf55 (patch)
tree2364ec2042d3291d69ffc4f28630aa1d26f49a92 /odb/context.cxx
parent98b4c0dd4df979b5521e08445d7ca4f79ab18e70 (diff)
Add upcase(string) function to context
Diffstat (limited to 'odb/context.cxx')
-rw-r--r--odb/context.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/odb/context.cxx b/odb/context.cxx
index 8b07da5..6fde943 100644
--- a/odb/context.cxx
+++ b/odb/context.cxx
@@ -3,7 +3,7 @@
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license : GNU GPL v3; see accompanying LICENSE file
-#include <cctype> // std::is{alpha,upper,lower}
+#include <cctype> // std::toupper, std::is{alpha,upper,lower}
#include <odb/context.hxx>
#include <odb/common.hxx>
@@ -136,6 +136,20 @@ context::
{
}
+string context::
+upcase (string const& s)
+{
+ string r;
+ string::size_type n (s.size ());
+
+ r.reserve (n);
+
+ for (string::size_type i (0); i < n; ++i)
+ r.push_back (toupper (s[i]));
+
+ return r;
+}
+
bool context::
comp_value_ (semantics::class_& c)
{