aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string
Commit message (Collapse)AuthorAgeFilesLines
* Fix MakeFormattableViewlukyan12 days3-4/+17
| | | | commit_hash:0e4b24c65451e75f168b456cd0d271ddebb7219d
* Use consistent format and naming in blocks' loggingngc2242025-04-101-1/+1
| | | | commit_hash:77f144acd2d648f4e32055553be332f1d25d6106
* YT-22593: More trivial TString->std::string migrationsbabenko2025-02-226-16/+15
| | | | | [nodiff:runtime] commit_hash:1ba799aed1703ab7c6304b6da7090b3337f768dd
* Make TCompactFlatMap formattableeshcherbin2025-02-032-0/+6
| | | | commit_hash:e5c092a9d0375881554f1d3bc905c662070956bf
* Refactor and improve crash handler stderr dumpsbabenko2025-02-011-21/+6
| | | | | | | | | 1. Prevent concurrent crashes to interleave in stderr 2. Cleaner and more compact formatting of registers dump 3. Omit `OLDMASK` (nobody seems to know what is it for) 4. Don't print the top backtrace frame twice 5. Code cosmetics commit_hash:f7a4c960b3400d6dfb0f8f60317aa524611d2fd0
* Squeeze contiguous sequences of blocks in loggingngc2242025-01-143-0/+192
| | | | commit_hash:5dda6f5ef324f03c99af3dae32ebf4a059f02bd3
* YT-18571: library/cpp/yt/small_containers -> library/cpp/yt/compact_containersbabenko2025-01-123-4/+4
| | | | commit_hash:fc31d2770ebeffeb513c4535bd146c731b7f78fb
* YT: Removed extra trailing comma in std::tuple formattingbulatman2025-01-102-1/+8
| | | | commit_hash:19b37bd3d7e3b4d80e4844676c881bbef1fec76b
* YT-21233: Issues and tidying up of rXXXXXXarkady-e1ppa2024-12-251-1/+2
| | | | commit_hash:19481c9fbb008aab4f4d676f1a3a242f6e90e90e
* YT-21233: Adjust (To/From)ErrorAttributeValue CPOs, revert ConvertTo ↵arkady-e1ppa2024-12-252-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | becoming CPO, move TErrorCode and TError to library/cpp/yt/error \[nodiff:caesar\] List of changes: 1) Make `ConvertTo` a normal function again (basically, a revert of previous change). It turned out to be very inconvenient entry point 2) Introduce concept for "Primitive types" which are handled without yt/core module. Please note that inclusion of core **does not** affect work with primitive types (otherwise we would be facing and ODR violation). These are numerics, duration, instant, string-like objects and guid 3) Introduce `FromErrorAttributeValue` which is a substitute to `ConvertTo` with special behavior (see below) 4) Scheme for (de-)serialization has changed: 1) Primitive types are handled via `ConvertToTextYsonString` and `ConvertFromTextYsonString` 2) Other types are not supported without yt/core. Otherwise `ConvertToYsonString(value, EYsonFormat::Text)` used for serialization and `ConvertTo<T>(value)` for deserialization. 5) New format of attribute value storage allows to not care about concrete type of the attribute (text yson strings can be detected since they start with `\"` and deserialized so are text yson bools, everything else is already human readable). This drops dependency on `TTokenizer` 6) Some small parts (e.g. enums or constants or aliases) of yt/core/misc files were moved to library/cpp/yt/\* locations and re-included to drop dependencies of stripped\_error on them 7) `TErrorAttributes` is now a simple hash map instead of a handle to `IAttributeDictionary` 8) `ExtractFromAttributes` weak symbol is finally moved to library/cpp/yt/error due to point 9 allowing to fully drop dependency on `IAttributeDictionary`. Combined with point 7 this drops dep on yt/core/ytree altogether 9) Moved `TErrorCode` to library/cpp/yt/error. There is a logger there which forces dep on library/cpp/yt/logging. It is not required really, and can be later removed 10) Moved `TError` with format and macroes to library/cpp/yt/error. It still (and probably forever will) depend on yson. What can be done next: Switch TYsonString to TString and move ConvertTo/FromTextYsonString to library/cpp/yt/error. This would remove dep on library/cpp/yt/yson\_string commit_hash:6f11dc478ab782a1f98a5aedcd45a4800d3f4e7b
* YT-23435: Parse format string at compile timearkady-e1ppa2024-11-186-54/+251
| | | | commit_hash:804530d1ee861ff42d7d8cad25d9f569b4feaacf
* YT-22885: DEFINE_ENUM_UNKNOWN_VALUE, string-related conversionsbabenko2024-10-264-81/+116
| | | | commit_hash:14c7e42422af750383f04855b4a7ea6b267b92d2
* YTORM-1187: Fix IN and BETWEEN expression work with indexesdgolear2024-10-172-31/+29
| | | | commit_hash:12d86de033f73ea238ebde7f47b689d30014119a
* Fancier error messages upon static analysis check failurearkady-e1ppa2024-10-161-34/+6
| | | | commit_hash:f939fba86939275047d2eca49b11bec3d0ea3ce7
* Extract string_builderbabenko2024-10-136-178/+218
| | | | commit_hash:1573c88f09db79bab2755c9c2c3ffd0bc219b2d2
* std::variant formatter: require that arguments are formattablepavook2024-09-192-0/+2
| | | | commit_hash:f3123d7cb2022bdc565cc9aadd347deb2cd235d3
* remove cpp/yt/misc no longer depends on cpp/yt/stringarkady-e1ppa2024-09-181-1/+56
| | | | commit_hash:429a843ed1a0e0fe3a5bc7d237f586b6671b8997
* Revert "YT-21306: Add EnumHasDefaultValue"dtorilov2024-08-201-5/+0
| | | | | | This reverts commit d9b67f1778da2d15dd94f7285afe4e3490a233ab, reversing changes made to 461a09e0c18bd14cef7df8060e7f9537e3ad74b5. 92cdaf4185661b7058f6a30d5a532ad40b725345
* YT-22512: Static analysis for TError method, ctors and related macrosarkady-e1ppa2024-08-133-124/+128
| | | | | | | | | | | | | | | | | | | | | Static analysis enabled for TError creation and related macros TRuntimeFormat can be used to disable this feature, but requires copying the viewed object. See NYT::TError::DisableFormat overloads to optimize constructions which want to move the given string Note to future readers: TError is not "perfect-forwarding" unfriendly class. This means that the code ``` template <class... TArgs> TError MakeError(TArgs&&... args) { return TError(std::forward<TArgs>(args)...); } ``` will not compile and needs to be properly adjusted (see. TError::Wrap for implementation example) This implies that emplace construction in containers will not work either. Use move construction instead, as it is simply a pointer swap and therefore free Annotations: [nodiff:caesar] cff12f05849402d09a4487bad26ffcd968215dc7
* YT-21306: Add EnumHasDefaultValuedtorilov2024-08-081-0/+5
| | | | d9b67f1778da2d15dd94f7285afe4e3490a233ab
* YT-22473: Enable for-each formatting in known rangesarkady-e1ppa2024-08-075-17/+197
| | | | 5a3405e64b730f0056e381af07658d6c2edcb92b
* YT-21868: Reorganize files to prevent unclear missing include errorsarkady-e1ppa2024-07-0210-344/+433
| | | | | Moving files around so that include of either `string_builder.h` or `format.h` would result in being able to use both `Format` and `TStringBuilder` 8a2abbea2ae7027c1cd3a243ab3de55bdd5d3d27
* Pre-vacation babenko issuesarkady-e1ppa2024-07-013-3/+7
| | | | 7be48a0651838e770b920150e0348bf3e92416d2
* YT-21868: Enable stat analysis in some other placesarkady-e1ppa2024-06-139-68/+78
| | | | | | | | | | | We slightly rework inner workings of stat analysis. For almost any sane use case the behavior is identical, but should compile a little faster. If you send string literals like `char[N]` or `const char*` make them constexpr. If you can't (e.g. `ex.what()` case) wrap it in `TStringBuf`, if you want the "by the book; 100% right" solution then wrap it in `TRuntimeFormat` instead. `SetRequestInfo` methods now statically checks the format. Only one error was found -- hooray! Some other internal stuff was added, a lot removed -- don't worry about it. You won't be able to see the difference 62050dfe8a9cedc1289f18e80397ff33a8e2ecdb
* YT-21868: Delete unneeded ToString methodsarkady-e1ppa2024-06-124-14/+21
| | | | e856aa45df227b86e8b121852d3774bb2504193b
* Intermediate changesrobot-piglet2024-06-121-0/+314
|
* More cosmetic issuesarkady-e1ppa2024-06-114-39/+39
| | | | 810902d6e6c3104880e1ab3b34d29a8aa4bec21b
* YT-21868: Refactor NYT::Formatarkady-e1ppa2024-06-0715-675/+1035
| | | | | | | | | | | | | | | | | | | | 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
|