]> git.tdb.fi Git - libs/core.git/blobdiff - source/jisx0201.cpp
Further style and comment adjustments
[libs/core.git] / source / jisx0201.cpp
index 9c1e92938bb7700b7b1587bc03d321e284653a85..d3fe635ce90beda61e2f99cc8aef5fc88e0794e0 100644 (file)
@@ -15,20 +15,20 @@ namespace Codecs {
 void JisX0201::Encoder::encode_char(UnicodeChar ch, string &buf)
 {
        if(ch>=0 && ch<=0x7F && ch!=0x5C && ch!=0x7E)
-               buf+=ch;
+               buf += ch;
        else if(ch==0xA5)
-               buf+=0x5C;
+               buf += 0x5C;
        else if(ch==0x203E)
-               buf+=0x7E;
+               buf += 0x7E;
        else if(ch>=0xFF61 && ch<=0xFF9F)
-               buf+=ch-0xFEC0;
+               buf += ch-0xFEC0;
        else
                error(ch, buf, "Can't express character in JIS X 0201");
 }
 
 void JisX0201::Encoder::transliterate(UnicodeChar, string &buf)
 {
-       buf+='?';
+       buf += '?';
 }
 
 
@@ -37,18 +37,18 @@ UnicodeChar JisX0201::Decoder::decode_char(const string &str, string::const_iter
        if(i==str.end())
                return error("No input");
 
-       unsigned char ch=*i;
+       unsigned char ch = *i;
        UnicodeChar result;
        if(ch==0x5C)
-               result=0xA5;
+               result = 0xA5;
        else if(ch==0x7E)
-               result=0x203E;
+               result = 0x203E;
        else if(ch<=0x7F)
-               result=ch;
+               result = ch;
        else if(ch>=0xA1 && ch<=0xDF)
-               result=ch+0xFEC0;
+               result = ch+0xFEC0;
        else
-               result=error("Undefined JIS X 0201 character");
+               result = error("Undefined JIS X 0201 character");
 
        ++i;
        return result;