diff options
author | sereglond <sereglond@yandex-team.ru> | 2022-02-10 16:47:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:46 +0300 |
commit | eb3d925534734c808602b31b38b953677f0a279f (patch) | |
tree | 4222ef8dc375ee9f30b68a004ee42a0845e005b6 /library/cpp/charset/cp_encrec.cpp | |
parent | 4c8065245df3ea26b7757bcb1f8218df287f9148 (diff) | |
download | ydb-eb3d925534734c808602b31b38b953677f0a279f.tar.gz |
Restoring authorship annotation for <sereglond@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/charset/cp_encrec.cpp')
-rw-r--r-- | library/cpp/charset/cp_encrec.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/charset/cp_encrec.cpp b/library/cpp/charset/cp_encrec.cpp index e4570cd628..60009bf5d4 100644 --- a/library/cpp/charset/cp_encrec.cpp +++ b/library/cpp/charset/cp_encrec.cpp @@ -1,13 +1,13 @@ #include "codepage.h" -#include <util/stream/output.h> - -void Encoder::Tr(const wchar32* in, char* out, size_t len) const { +#include <util/stream/output.h> + +void Encoder::Tr(const wchar32* in, char* out, size_t len) const { while (len--) *out++ = Tr(*in++); } -void Encoder::Tr(const wchar32* in, char* out) const { +void Encoder::Tr(const wchar32* in, char* out) const { do { *out++ = Tr(*in); } while (*in++); @@ -21,31 +21,31 @@ void Recoder::Create(const CodePage& source, const Encoder* wideTarget) { } void Recoder::Create(const CodePage& page, const Encoder* widePage, wchar32 (*mapfunc)(wchar32)) { - for (size_t i = 0; i != 256; ++i) { + for (size_t i = 0; i != 256; ++i) { char c = widePage->Code((*mapfunc)(page.unicode[i])); Table[i] = (c == 0 && i != 0) ? (unsigned char)i : (unsigned char)c; } } -void Recoder::Tr(const char* in, char* out, size_t len) const { +void Recoder::Tr(const char* in, char* out, size_t len) const { while (len--) *out++ = Table[(unsigned char)*in++]; } -void Recoder::Tr(const char* in, char* out) const { +void Recoder::Tr(const char* in, char* out) const { do { *out++ = Table[(unsigned char)*in]; } while (*in++); } -void Recoder::Tr(char* in_out, size_t len) const { +void Recoder::Tr(char* in_out, size_t len) const { while (len--) { *in_out = Table[(unsigned char)*in_out]; in_out++; } } -void Recoder::Tr(char* in_out) const { +void Recoder::Tr(char* in_out) const { // assuming that '\0' <--> '\0' do { *in_out = Table[(unsigned char)*in_out]; |