cyson_enums.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. typedef enum yson_event_type {
  3. YSON_EVENT_BEGIN_STREAM = 0,
  4. YSON_EVENT_END_STREAM = 1,
  5. YSON_EVENT_BEGIN_LIST = 2,
  6. YSON_EVENT_END_LIST = 3,
  7. YSON_EVENT_BEGIN_MAP = 4,
  8. YSON_EVENT_END_MAP = 5,
  9. YSON_EVENT_BEGIN_ATTRIBUTES = 6,
  10. YSON_EVENT_END_ATTRIBUTES = 7,
  11. YSON_EVENT_KEY = 8,
  12. YSON_EVENT_SCALAR = 9,
  13. YSON_EVENT_ERROR = 10
  14. } yson_event_type;
  15. typedef enum yson_scalar_type {
  16. YSON_SCALAR_ENTITY = 0,
  17. YSON_SCALAR_BOOLEAN = 1,
  18. YSON_SCALAR_INT64 = 2,
  19. YSON_SCALAR_UINT64 = 3,
  20. YSON_SCALAR_FLOAT64 = 4,
  21. YSON_SCALAR_STRING = 5
  22. } yson_scalar_type;
  23. typedef enum yson_input_stream_result {
  24. YSON_INPUT_STREAM_RESULT_OK = 0,
  25. YSON_INPUT_STREAM_RESULT_EOF = 1,
  26. YSON_INPUT_STREAM_RESULT_ERROR = 2
  27. } yson_input_stream_result;
  28. typedef enum yson_output_stream_result {
  29. YSON_OUTPUT_STREAM_RESULT_OK = 0,
  30. YSON_OUTPUT_STREAM_RESULT_ERROR = 1
  31. } yson_output_stream_result;
  32. typedef enum yson_writer_result {
  33. YSON_WRITER_RESULT_OK = 0,
  34. YSON_WRITER_RESULT_BAD_STREAM = 1,
  35. YSON_WRITER_RESULT_ERROR = 2
  36. } yson_writer_result;
  37. typedef enum yson_stream_type {
  38. YSON_STREAM_TYPE_NODE = 0,
  39. YSON_STREAM_TYPE_LIST_FRAGMENT = 1,
  40. YSON_STREAM_TYPE_MAP_FRAGMENT = 2
  41. } yson_stream_type;