diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/html | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/html')
-rw-r--r-- | library/cpp/html/escape/escape.h | 2 | ||||
-rw-r--r-- | library/cpp/html/pcdata/pcdata.cpp | 16 | ||||
-rw-r--r-- | library/cpp/html/pcdata/pcdata.h | 6 | ||||
-rw-r--r-- | library/cpp/html/pcdata/pcdata_ut.cpp | 8 | ||||
-rw-r--r-- | library/cpp/html/pcdata/ut/ya.make | 16 | ||||
-rw-r--r-- | library/cpp/html/pcdata/ya.make | 20 |
6 files changed, 34 insertions, 34 deletions
diff --git a/library/cpp/html/escape/escape.h b/library/cpp/html/escape/escape.h index 1c45fc5193..6fc9fb4f1b 100644 --- a/library/cpp/html/escape/escape.h +++ b/library/cpp/html/escape/escape.h @@ -1,6 +1,6 @@ #pragma once -#include <util/generic/string.h> +#include <util/generic/string.h> namespace NHtml { TString EscapeAttributeValue(const TString& value); diff --git a/library/cpp/html/pcdata/pcdata.cpp b/library/cpp/html/pcdata/pcdata.cpp index 740c240fd2..70fe073bb9 100644 --- a/library/cpp/html/pcdata/pcdata.cpp +++ b/library/cpp/html/pcdata/pcdata.cpp @@ -1,10 +1,10 @@ #include "pcdata.h" -#include <util/string/strspn.h> - +#include <util/string/strspn.h> + static TCompactStrSpn sspn("\"<>&'"); -static void EncodeHtmlPcdataAppendInternal(const TStringBuf str, TString& strout, bool qAmp) { +static void EncodeHtmlPcdataAppendInternal(const TStringBuf str, TString& strout, bool qAmp) { const char* s = str.data(); const char* e = s + str.length(); @@ -49,18 +49,18 @@ static void EncodeHtmlPcdataAppendInternal(const TStringBuf str, TString& strout } } -void EncodeHtmlPcdataAppend(const TStringBuf str, TString& strout) { +void EncodeHtmlPcdataAppend(const TStringBuf str, TString& strout) { EncodeHtmlPcdataAppendInternal(str, strout, true); } -TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp) { - TString strout; +TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp) { + TString strout; EncodeHtmlPcdataAppendInternal(str, strout, qAmp); return strout; } -TString DecodeHtmlPcdata(const TString& sz) { - TString res; +TString DecodeHtmlPcdata(const TString& sz) { + TString res; const char* codes[] = {""", "<", ">", "'", "'", "&", "'", nullptr}; const char chars[] = {'\"', '<', '>', '\'', '\'', '&', '\''}; for (size_t i = 0; i < sz.length(); ++i) { diff --git a/library/cpp/html/pcdata/pcdata.h b/library/cpp/html/pcdata/pcdata.h index 7dd741f53d..c1de2d0a31 100644 --- a/library/cpp/html/pcdata/pcdata.h +++ b/library/cpp/html/pcdata/pcdata.h @@ -3,8 +3,8 @@ #include <util/generic/fwd.h> /// Converts a text into HTML-code. Special characters of HTML («<», «>», ...) replaced with entities. -TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp = true); -void EncodeHtmlPcdataAppend(const TStringBuf str, TString& strout); +TString EncodeHtmlPcdata(const TStringBuf str, bool qAmp = true); +void EncodeHtmlPcdataAppend(const TStringBuf str, TString& strout); /// Reverse of EncodeHtmlPcdata() -TString DecodeHtmlPcdata(const TString& sz); +TString DecodeHtmlPcdata(const TString& sz); diff --git a/library/cpp/html/pcdata/pcdata_ut.cpp b/library/cpp/html/pcdata/pcdata_ut.cpp index 5833f8bc59..6710d9dfce 100644 --- a/library/cpp/html/pcdata/pcdata_ut.cpp +++ b/library/cpp/html/pcdata/pcdata_ut.cpp @@ -6,18 +6,18 @@ Y_UNIT_TEST_SUITE(TPcdata) { Y_UNIT_TEST(TestStress) { { ui64 key = 0x000017C0B76C4E87ull; - TString res = EncodeHtmlPcdata(TStringBuf((const char*)&key, sizeof(key))); + TString res = EncodeHtmlPcdata(TStringBuf((const char*)&key, sizeof(key))); } for (size_t i = 0; i < 1000; ++i) { - const TString s = NUnitTest::RandomString(i, i); + const TString s = NUnitTest::RandomString(i, i); UNIT_ASSERT_VALUES_EQUAL(DecodeHtmlPcdata(EncodeHtmlPcdata(s)), s); } } Y_UNIT_TEST(Test1) { - const TString tests[] = { + const TString tests[] = { "qw&qw", "&<", ">&qw", @@ -33,7 +33,7 @@ Y_UNIT_TEST_SUITE(TPcdata) { } Y_UNIT_TEST(TestEncodeHtmlPcdataAppend) { - TString s; + TString s; EncodeHtmlPcdataAppend("m&m", s); EncodeHtmlPcdataAppend("'s", s); UNIT_ASSERT_VALUES_EQUAL(EncodeHtmlPcdata("m&m's"), s); diff --git a/library/cpp/html/pcdata/ut/ya.make b/library/cpp/html/pcdata/ut/ya.make index bc947baa89..ad9f9abe47 100644 --- a/library/cpp/html/pcdata/ut/ya.make +++ b/library/cpp/html/pcdata/ut/ya.make @@ -1,9 +1,9 @@ UNITTEST_FOR(library/cpp/html/pcdata) - -OWNER(vladon) - -SRCS( - pcdata_ut.cpp -) - -END() + +OWNER(vladon) + +SRCS( + pcdata_ut.cpp +) + +END() diff --git a/library/cpp/html/pcdata/ya.make b/library/cpp/html/pcdata/ya.make index 637220e706..957fd964c2 100644 --- a/library/cpp/html/pcdata/ya.make +++ b/library/cpp/html/pcdata/ya.make @@ -1,10 +1,10 @@ -LIBRARY() - -OWNER(vladon) - -SRCS( - pcdata.cpp - pcdata.h -) - -END() +LIBRARY() + +OWNER(vladon) + +SRCS( + pcdata.cpp + pcdata.h +) + +END() |