libopenraw
streamclone.h
1 /*
2  * libopenraw - streamclone.h
3  *
4  * Copyright (C) 2006 Hubert Figuière
5  *
6  * This library is free software: you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3 of
9  * the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 #ifndef __IO_STREAMCLONE_H__
23 #define __IO_STREAMCLONE_H__
24 
25 #include <sys/types.h>
26 #include <unistd.h>
27 
28 #include "stream.h"
29 
30 namespace OpenRaw {
31  namespace IO {
32 
36  : public Stream
37  {
38  public:
39  StreamClone(Stream *clone, off_t offset);
40  virtual ~StreamClone();
41 
42  virtual Error open();
43  virtual int close();
44  virtual int seek(off_t offset, int whence);
45  virtual int read(void *buf, size_t count);
46  virtual off_t filesize();
47 
48 
49  private:
51  StreamClone(const StreamClone& f);
53  StreamClone & operator=(const StreamClone&);
54 
55  Stream *m_cloned;
56  off_t m_offset;
57  };
58 
59  }
60 }
61 
62 #endif