Statistics
| Revision:

root / trunk / src / tools99 / strcase.cpp @ 1106

History | View | Annotate | Download (602 Bytes)

1
/*
2
 * $Id: strcase.cpp 1106 2013-07-11 20:54:23Z johnoel $
3
 *
4
 * Author: John Sibert
5
 * Copyright (c) 2010-2012 ADMB Foundation
6
 */
7
#include "adstring.hpp"
8

    
9
void adstring::to_lower(void)
10
{
11
  for (unsigned int i=1; i <= size(); i++)
12
#ifdef _MSC_VER
13
    s[i] = tolower(s[i]);
14
#else
15
    s[i] = std::tolower(s[i]);
16
#endif
17
}
18

    
19
void adstring::to_upper(void)
20
{
21
  for (unsigned int i=1; i <= size(); i++)
22
#ifdef _MSC_VER
23
    s[i] = toupper(s[i]);
24
#else
25
    s[i] = std::toupper(s[i]);
26
#endif
27
}
28

    
29
adstring to_lower(adstring& s)
30
{
31
  adstring t = s;
32
  t.to_lower();
33
  return(t);
34
}
35

    
36
adstring to_upper(adstring& s)
37
{
38
  adstring t = s;
39
  t.to_upper();
40
  return(t);
41
}