event.cpp 473 B

123456789101112131415161718
  1. #include "event.h"
  2. #include <library/cpp/yson_pull/detail/cescape.h>
  3. #include <util/stream/output.h>
  4. using namespace NYsonPull;
  5. template <>
  6. void Out<TEvent>(IOutputStream& out, const TEvent& value) {
  7. out << '(' << value.Type();
  8. if (value.Type() == EEventType::Scalar) {
  9. out << ' ' << value.AsScalar();
  10. } else if (value.Type() == EEventType::Key) {
  11. out << ' ' << NYsonPull::NDetail::NCEscape::quote(value.AsString());
  12. }
  13. out << ')';
  14. }