multi.h 608 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "input.h"
  3. /**
  4. * @addtogroup Streams_Multi
  5. * @{
  6. */
  7. /**
  8. * A proxy input stream that concatenates two slave streams into one.
  9. */
  10. class TMultiInput: public IInputStream {
  11. public:
  12. TMultiInput(IInputStream* f Y_LIFETIME_BOUND, IInputStream* s Y_LIFETIME_BOUND) noexcept;
  13. ~TMultiInput() override;
  14. private:
  15. size_t DoRead(void* buf, size_t len) override;
  16. size_t DoSkip(size_t len) override;
  17. size_t DoReadTo(TString& st, char ch) override;
  18. private:
  19. IInputStream* C_;
  20. IInputStream* N_;
  21. };
  22. /**
  23. * See also "util/stream/tee.h" for multi output.
  24. */
  25. /** @} */