summaryrefslogtreecommitdiff
path: root/trunk/CIAO/CIDLC/Upcase.hpp
blob: ca30079bd9807f3adfa65ddcc86ad040df0b3991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// file      : CIDLC/Upcase.hpp
// author    : Jeff Parsons <j.parsons@vanderbilt.edu>
// cvs-id    : $Id$

#ifndef UPCASE_HPP
#define UPCASE_HPP

#include <cctype>

namespace
{
  // On some platforms toupper can be something other than a
  // function.
  int
  upcase (int c)
  {
    return std::toupper (c);
  }

  void
  str_upcase (std::string &str)
  {
    std::transform (str.begin (),
                    str.end (),
                    str.begin (),
                    upcase);
  }
}

#endif  // UPCASE_HPP