summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string
Commit message (Collapse)AuthorAgeFilesLines
* YT-21868: Refactor NYT::Formatarkady-e1ppa2024-06-0715-670/+1030
| | | | | | | | | | | | | | | | | | | | NYT::Format had several problems: 1. There are too many ways to enable printing of T. Not all are equally good. You could specialize TValueFormatter, you could write an overload of FormatValue, you could write an overload of ToString, you could write an overload of operator << for special stream or you could specialize the Out function. 2. If you attempt to print T which cannot be printed, you get a linker error without a proper source location which is very frustrating to work with. 3. There is no static analysis of format string performed even when it is possible. 4. If you write FormatValue overload, you still have to write ToString overload if you want to use this function (and people tend to use it quite a bit, since it is defined for util types and enums. This pr addresses these issues to some extent. Relevant changes: 1. The only way to support NYT::Format is to define the FormatValue overload. Otherwise, you get a compile-time error. 2. Format overloads have changed: Now you have two options for general use: ``` TString Format(TStaticFormat<TArgs...> fmt, TArgs&&... args); TString Format(TRuntimeFormat fmt, TArgs&&... args); ``` Either overload checks if TArg has a FormatValue overload. TStaticFormat performs a compile-time check of flags and the argument count. It binds to any string literal and constexpr string/string_view (and TStringBuf). TRuntimeFormat has to be mentioned explicitly. Otherwise, you will get a compile-time error for using runtime variable as a format. 3(!!!). Types which name begins with NYT:: have a specialization of ToString function which uses FormatValue. Thus, if you write class in namespace NYT and define FormatValue, you get ToString automatically. If your type is not from namespace enclosing NYT, you can just call NYT::ToString for the same effect. This limitation was caused by the fact, that we cannot review all of the external projects code which might inherit from stl classes or adopt some other questionable code practises which may completely break the dispatching mechanism of ToString due to the specialization (there were such cases). Proper documentation of this library will be added soon, so that this interaction is made known. This limitation might be lifted later 77beb68082e10aaf48be1842aad8aba63f26c1bd
* Fix build due to accidental c++23 usearkady-e1ppa2024-05-311-2/+7
| | | | feeb90a4704dca0309a6252ea872283ea9302a4b
* YT-21868: Static analysis of format string in loggingarkady-e1ppa2024-05-302-0/+240
| | | | | | | | | | | | | Added static analysis to format of YT_LOG_XXX macro's. We expect you to write format string as first or the second argument and follow the rules as if you are writing arguments for `NYT::Format`, which match those of printf: https://en.cppreference.com/w/cpp/io/c/fprintf plus few extra flags like 'v'. At the moment analyser checks if flags sequences is 1. Correctly terminated 2. Only contains specifiers valid for a given argument (if we are parsing nth argument of type T, then T must have all specifiers from its list of Conversion or Flag specifiers. (2) Also means that the number of flag sequences must match the number of arguments supplied to format. You can specialize `TFormatArg<T>` which is used to determine allowed Conversion and Flag specifiers to customise rules of static analysis. E.g. you can introduce new flags to the mix which you promise to parse in the related FormatValue function. If you feel like this produces to much overhead in terms of compile time, you are free to use macro YT_DISABLE_FORMAT_STATIC_ANALYSIS to turn the entire thing into a no-op. We have measured compile time to be affected by roughly 3-5% in a log intensive files. ae6def509474e8a42027bb4ed84ac040509b7c85
* YT: Add NYT::FormatVectorionagamed2024-05-132-0/+74
| | | | 5da23499c430efcdae980093fd84c8391537660c
* YT-21233: Remove TSimpleException and teach TCompositeException storing ↵arkady-e1ppa2024-03-282-2/+2
| | | | | | | simple attributes Expand the CompositeException 9a10ec65bfc1df854e03bb3a4d8d0a0c0e4a3a5d
* ,Speedup scheduling failures commitrogday2024-02-162-0/+12
| | | | 62c4cf20966ac12ba500e1b7f7f048969a8aacca
* Move enum_indexed_array from misc to containersbabenko2024-01-291-1/+2
|
* Drop TEnumIndexedVectorbabenko2024-01-272-22/+0
|
* Introduce TEnumIndexedArray as a refurbished version of TEnumIndexedVectorbabenko2024-01-252-0/+23
|
* feat contrib: aiogram 3armenqa2024-01-196-153/+0
| | | | Relates: https://st.yandex-team.ru/, https://st.yandex-team.ru/
* Library import 6 (#888)AlexSm2024-01-091-0/+9
|
* External build system generator release 65robot-ya-builder2023-12-051-3/+3
| | | | Update tools: yexport, os-yexport
* add darwin-arm64 CMakeListsdcherednik2023-11-202-0/+29
|
* YT-19210: expose YQL shared library for YT.max422023-07-291-0/+212
| | | | After this, a new target libyqlplugin.so appears. in open-source cmake build. Diff in open-source YDB repo looks like the following: https://paste.yandex-team.ru/f302bdb4-7ef2-4362-91c7-6ca45f329264
* Support h-format for escaped (but unquoted) stringsbabenko2023-07-262-10/+32
|
* Introduce TLazyMultiValueFormatterifsmirnov2023-07-063-0/+81
|
* Revert "YT-19324: move YT provider to ydb/library/yql"max422023-06-301-212/+0
| | | | This reverts commit ca272f12fdd0e8d5c3e957fc87939148f1caaf72, reversing changes made to 49f8acfc8b0b5c0071b804423bcf53fda26c7c12.
* YT-19324: move YT provider to ydb/library/yqlmax422023-06-301-0/+212
| | | | | | | | | | | | | | This commit is formed by the following script: https://paste.yandex-team.ru/6f92e4b8-efc5-4d34-948b-15ee2accd7e7/text. This commit has zero effect on all projects that depend on YQL. The summary of changes: - `yql/providers/yt -> ydb/library/yql/providers/yt `- the whole implementation of YT provider is moved into YDB code base for further export as a part of YT YQL plugin shared library; - `yql/providers/stat/{expr_nodes,uploader} -> ydb/library/yql/providers/stat/{expr_nodes,uploader}` - a small interface without implementation and the description of stat expr nodes; - `yql/core/extract_predicate/ut -> ydb/library/yql/core/extract_predicate/ut`; - `yql/core/{ut,ut_common} -> ydb/library/yql/core/{ut,ut_common}`; - `yql/core` is gone; - `yql/library/url_preprocessing -> ydb/library/yql/core/url_preprocessing`. **NB**: all new targets inside `ydb/` are under `IF (NOT CMAKE_EXPORT)` clause which disables them from open-source cmake generation and ya make build. They will be enabled in the subsequent commits.
* YT: Escape back slash when format string with quotesbulatman2023-06-282-0/+9
|
* add ymake export to ydbalexv-smirnov2023-06-132-0/+51
|
* YT: Fix ParseEnum when custom domain names usedbulatman2023-06-012-1/+20
|
* Remove extra semicolons in ytbulatman2023-05-161-1/+1
|
* YT-18920: Add `TryDecodeEnumValue()`galtsev2023-05-043-23/+49
|
* YT-18920: Parse unknown enum valuesgaltsev2023-04-191-1/+25
|
* External build system generator release 29robot-ya-builder2023-04-191-1/+1
| | | Update tools: yexport
* Revert ymake build from ydb oss exportalexv-smirnov2023-03-282-51/+0
|
* External build system generator release 21robot-ya-builder2023-03-171-3/+3
| | | Update tools: yexport
* add library/cpp/actors, ymake build to ydb oss exportalexv-smirnov2023-03-152-0/+51
|
* YT-18571: Refactor YT enums to make them Arcadia-friendlybabenko2023-03-142-18/+12
|
* Intermediate changesrobot-piglet2023-03-092-0/+26
|
* Intermediate changesrobot-piglet2023-03-073-2/+2
|
* External build system generator release 17robot-ya-builder2023-03-061-1/+1
| | | Update tools: yexport
* Enable -Wdeprecated-this-capture for all YT projectsbabenko2023-03-033-0/+9
|
* Intermediate changesrobot-piglet2023-02-073-12/+12
|
* Intermediate changesrobot-piglet2023-02-073-12/+12
|
* External build system generator release 12robot-ya-builder2023-01-311-1/+1
| | | Update tools: yexport
* External build system generator release 8robot-ya-builder2023-01-174-4/+4
| | | Update tools: yexport
* Sync linux-headers instead of using system onesthegeorg2022-12-154-16/+81
|
* YT: Support multiple literals in YPathJoindgolear2022-10-182-7/+14
|
* Fix of aligned_free on windowsaleexfi2022-10-041-2/+2
|
* Sane handling of %x and %X for pointers in Formatbabenko2022-09-193-5/+38
|
* Natively support %x and %X in Formatbabenko2022-08-266-86/+287
|
* intermediate changesarcadia-devtools2022-06-011-0/+1
| | | | ref:92c37846cff40718ed69273194a02776aa72f499
* intermediate changesarcadia-devtools2022-05-011-2/+1
| | | | ref:aafcc5ea05b838722ba43f58219d93b62e33ed1a
* intermediate changesarcadia-devtools2022-03-152-47/+0
| | | | ref:ca7a95e8c9a9d780f96497136a152091d54e61b5
* Improve SystemCommand check in YDB CLI, KIKIMR-14321pnv12022-03-011-0/+9
| | | | ref:fe5ed49138dce046a93c364cc8879fad3abf3eef
* intermediate changesarcadia-devtools2022-02-181-0/+13
| | | | ref:1a0585d83f27cb6fb5b9c4f68a08177e10faf3b3
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.arivkin2022-02-101-13/+13
|
* Restoring authorship annotation for <[email protected]>. Commit 1 of 2.arivkin2022-02-101-13/+13
|
* Restoring authorship annotation for <[email protected]>. Commit 2 of 2.renadeen2022-02-103-6/+6
|