udf_validate.h 1001 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <util/generic/string.h>
  3. #include <util/generic/strbuf.h>
  4. #include <library/cpp/deprecated/enum_codegen/enum_codegen.h>
  5. namespace NYql {
  6. namespace NUdf {
  7. #define UDF_VALIDATE_MODE(XX) \
  8. XX(None, 0) \
  9. XX(Lazy, 1) \
  10. XX(Greedy, 2) \
  11. XX(Max, 3) \
  12. #define UDF_VALIDATE_POLICY(XX) \
  13. XX(Fail, 0) \
  14. XX(Exception, 1) \
  15. XX(Max, 2) \
  16. enum class EValidateMode : ui8 {
  17. UDF_VALIDATE_MODE(ENUM_VALUE_GEN)
  18. };
  19. enum class EValidatePolicy : ui8 {
  20. UDF_VALIDATE_POLICY(ENUM_VALUE_GEN)
  21. };
  22. TString ValidateModeAvailables();
  23. TStringBuf ValidateModeAsStr(EValidateMode validateMode);
  24. EValidateMode ValidateModeByStr(const TString& verifyModeStr);
  25. TStringBuf ValidatePolicyAsStr(EValidatePolicy verifyPolicy);
  26. EValidatePolicy ValidatePolicyByStr(const TString& verifyPolicy);
  27. } // namspace NUdf
  28. } // namspace NYql