Commit ce0b6f7d by Szeberényi Imre

locale

parent 8a0db796
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
#ifndef ALLAPOTGEP_H #ifndef ALLAPOTGEP_H
#define ALLAPOTGEP_H #define ALLAPOTGEP_H
#include <ctype.h> #include <locale>
#include <cstring>
#include <iostream> #include <iostream>
#include <exception> #include <exception>
...@@ -84,7 +83,8 @@ public: ...@@ -84,7 +83,8 @@ public:
* @return Bazis enum kontans * @return Bazis enum kontans
*/ */
inline Bazis cast(char b) { inline Bazis cast(char b) {
char k = tolower(b); std::locale loc;
char k = std::tolower(b, loc);
Bazis ret; Bazis ret;
switch(k) { switch(k) {
case 'a': ret = Adenin; break; case 'a': ret = Adenin; break;
...@@ -111,8 +111,10 @@ inline char cast(Bazis b, bool upper = true) { ...@@ -111,8 +111,10 @@ inline char cast(Bazis b, bool upper = true) {
case Guanin: ret = 'g'; break; case Guanin: ret = 'g'; break;
case Timin: ret = 't'; break; case Timin: ret = 't'; break;
} }
if(upper) if(upper) {
ret = toupper(ret); std::locale loc;
ret = std::toupper(ret, loc);
}
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment