diff options
author | uht <uht@yandex-team.ru> | 2022-02-10 16:49:56 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:56 +0300 |
commit | 1191d1e479d83a18a813a5107573ce22a2f0bbb4 (patch) | |
tree | 6cbbb7e1c6309393dde43830532c7c7b633b1e4b /library/cpp/charset/cp_encrec.cpp | |
parent | fa977fb6c7b468a86cf33f948fdae8e0c83d3cad (diff) | |
download | ydb-1191d1e479d83a18a813a5107573ce22a2f0bbb4.tar.gz |
Restoring authorship annotation for <uht@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 | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/charset/cp_encrec.cpp b/library/cpp/charset/cp_encrec.cpp index e4570cd6284..33f46722a47 100644 --- a/library/cpp/charset/cp_encrec.cpp +++ b/library/cpp/charset/cp_encrec.cpp @@ -4,50 +4,50 @@ void Encoder::Tr(const wchar32* in, char* out, size_t len) const { while (len--) - *out++ = Tr(*in++); -} - + *out++ = Tr(*in++); +} + void Encoder::Tr(const wchar32* in, char* out) const { - do { - *out++ = Tr(*in); - } while (*in++); -} - + do { + *out++ = Tr(*in); + } while (*in++); +} + void Recoder::Create(const CodePage& source, const Encoder* wideTarget) { for (size_t i = 0; i != 256; ++i) { - Table[i] = wideTarget->Tr(source.unicode[i]); + Table[i] = wideTarget->Tr(source.unicode[i]); Y_ASSERT(Table[i] != 0 || i == 0); - } -} - + } +} + void Recoder::Create(const CodePage& page, const Encoder* widePage, wchar32 (*mapfunc)(wchar32)) { 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; - } -} - + 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 { - while (len--) - *out++ = Table[(unsigned char)*in++]; -} - + while (len--) + *out++ = Table[(unsigned char)*in++]; +} + void Recoder::Tr(const char* in, char* out) const { - do { - *out++ = Table[(unsigned char)*in]; - } while (*in++); -} - + do { + *out++ = Table[(unsigned char)*in]; + } while (*in++); +} + void Recoder::Tr(char* in_out, size_t len) const { - while (len--) { - *in_out = Table[(unsigned char)*in_out]; - in_out++; - } -} - + while (len--) { + *in_out = Table[(unsigned char)*in_out]; + in_out++; + } +} + void Recoder::Tr(char* in_out) const { - // assuming that '\0' <--> '\0' - do { - *in_out = Table[(unsigned char)*in_out]; - } while (*in_out++); -} + // assuming that '\0' <--> '\0' + do { + *in_out = Table[(unsigned char)*in_out]; + } while (*in_out++); +} |