10 |
#include <stdexcept> |
#include <stdexcept> |
11 |
#include <time.h> |
#include <time.h> |
12 |
#include <sys/time.h> |
#include <sys/time.h> |
13 |
|
#include <stdlib.h> |
14 |
|
|
15 |
|
#include <cstring> |
16 |
#include "util.h" |
#include "util.h" |
17 |
|
|
18 |
using namespace std; |
using namespace std; |
107 |
return retval; |
return retval; |
108 |
} |
} |
109 |
|
|
110 |
|
char my_toupper(char ch) |
111 |
|
{ |
112 |
|
if (ch == 'æ') |
113 |
|
return 'Æ'; |
114 |
|
if (ch == 'ø') |
115 |
|
return 'Ø'; |
116 |
|
if (ch == 'å') |
117 |
|
return 'Å'; |
118 |
|
|
119 |
|
return ::toupper(ch); |
120 |
|
} |
121 |
|
|
122 |
|
char my_tolower(char ch) |
123 |
|
{ |
124 |
|
if (ch == 'Æ') |
125 |
|
return 'æ'; |
126 |
|
if (ch == 'Ø') |
127 |
|
return 'ø'; |
128 |
|
if (ch == 'Å') |
129 |
|
return 'å'; |
130 |
|
|
131 |
|
return ::tolower(ch); |
132 |
|
} |
133 |
string str_toupper(string str) |
string str_toupper(string str) |
134 |
{ |
{ |
135 |
for (unsigned i=0; i<str.length(); ++i) |
for (unsigned i=0; i<str.length(); ++i) |
136 |
{ |
{ |
137 |
str.replace(i, 1 ,1, ::toupper(str.at(i))); |
str.replace(i, 1 ,1, my_toupper(str.at(i))); |
138 |
} |
} |
139 |
return str; |
return str; |
140 |
} |
} |
143 |
{ |
{ |
144 |
for (unsigned i=0; i<str.length(); ++i) |
for (unsigned i=0; i<str.length(); ++i) |
145 |
{ |
{ |
146 |
str.replace(i, 1 ,1, ::tolower(str.at(i))); |
str.replace(i, 1 ,1, my_tolower(str.at(i))); |
147 |
} |
} |
148 |
return str; |
return str; |
149 |
} |
} |