yql_issue_utils.h 927 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "yql_issue.h"
  3. #include <util/generic/ylimits.h>
  4. #include <util/system/types.h>
  5. namespace NYql {
  6. struct TTruncateIssueOpts {
  7. #define YQL_TRUNC_DECL_FIELD(type, name, def) \
  8. TTruncateIssueOpts& Set##name(type arg##name)& { \
  9. name = arg##name; \
  10. return *this; \
  11. } \
  12. TTruncateIssueOpts&& Set##name(type arg##name)&& { \
  13. name = arg##name; \
  14. return std::move(*this); \
  15. } \
  16. type name = def;
  17. YQL_TRUNC_DECL_FIELD(ui32, MaxLevels, Max<ui32>())
  18. YQL_TRUNC_DECL_FIELD(ui32, KeepTailLevels, 1)
  19. #undef YQL_TRUNC_DECL_FIELD
  20. };
  21. TIssue TruncateIssueLevels(const TIssue& topIssue, TTruncateIssueOpts opts = {});
  22. } // namespace NYql