ADMB Documentation  11.1.2364
 All Classes Files Functions Variables Typedefs Friends Defines
strcase.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: strcase.cpp 2364 2014-09-17 00:32:43Z johnoel $
00003  *
00004  * Author: John Sibert
00005  * Copyright (c) 2010-2012 ADMB Foundation
00006  */
00007 #include "adstring.hpp"
00008 
00009 void adstring::to_lower(void)
00010 {
00011   for (unsigned int i=1; i <= size(); i++)
00012 #ifdef _MSC_VER
00013     s[i] = (unsigned char)tolower(s[i]);
00014 #else
00015     s[i] = (unsigned char)std::tolower(s[i]);
00016 #endif
00017 }
00018 
00019 void adstring::to_upper(void)
00020 {
00021   for (unsigned int i=1; i <= size(); i++)
00022 #ifdef _MSC_VER
00023     s[i] = (unsigned char)toupper(s[i]);
00024 #else
00025     s[i] = (unsigned char)std::toupper(s[i]);
00026 #endif
00027 }
00028 
00029 adstring to_lower(adstring& s)
00030 {
00031   adstring t = s;
00032   t.to_lower();
00033   return(t);
00034 }
00035 
00036 adstring to_upper(adstring& s)
00037 {
00038   adstring t = s;
00039   t.to_upper();
00040   return(t);
00041 }