/mordor/streams/cat.h
C Header | 37 lines | 26 code | 10 blank | 1 comment | 1 complexity | 42602f7d44af4696689770e25b7a9a3f MD5 | raw file
Possible License(s): BSD-3-Clause
- #ifndef __MORDOR_CAT_STREAM__
- #define __MORDOR_CAT_STREAM__
- // Copyright (c) 2009 - Mozy, Inc.
- #include <vector>
- #include "stream.h"
- namespace Mordor {
- class CatStream : public Stream
- {
- public:
- CatStream(const std::vector<Stream::ptr> &streams);
- bool supportsRead() { return true; }
- bool supportsSeek() { return m_seekable; }
- bool supportsTell() { return true; }
- bool supportsSize() { return m_size != -1ll; }
- using Stream::read;
- size_t read(Buffer &buffer, size_t length);
- long long seek(long long offset, Anchor anchor = BEGIN);
- long long size();
- private:
- std::vector<Stream::ptr> m_streams;
- std::vector<Stream::ptr>::iterator m_it;
- bool m_seekable;
- long long m_size;
- long long m_pos;
- };
- };
- #endif