libopenraw
rawcontainer.h
1 /*
2  * libopenraw - rawcontainer.h
3  *
4  * Copyright (C) 2006-2007 Hubert Figuiere
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 
23 
24 #ifndef _RAWCONTAINER_H_
25 #define _RAWCONTAINER_H_
26 
27 #include <sys/types.h>
28 
29 #include <libopenraw/io.h>
30 #include <libopenraw/types.h>
31 
32 
33 namespace OpenRaw {
34  namespace IO {
35  class Stream;
36  }
37 
38  namespace Internals {
39 
40 
45  {
46  public:
48  typedef enum {
49  ENDIAN_NULL = 0,
52  } EndianType;
53 
59  RawContainer(IO::Stream *_file, off_t offset);
61  virtual ~RawContainer();
62 
63  IO::Stream *file()
64  {
65  return m_file;
66  }
67  EndianType endian() const
68  {
69  return m_endian;
70  }
71 
72  bool readInt8(IO::Stream *f, int8_t & v);
73  bool readUInt8(IO::Stream *f, uint8_t & v);
75  bool readInt16(IO::Stream *f, int16_t & v);
77  bool readInt32(IO::Stream *f, int32_t & v);
79  bool readUInt16(IO::Stream *f, uint16_t & v);
81  bool readUInt32(IO::Stream *f, uint32_t & v);
89  size_t fetchData(void *buf, const off_t offset, const size_t buf_size);
90 
91  protected:
92 
93  RawContainer(const RawContainer&);
94  RawContainer & operator=(const RawContainer &);
95 
96  void setEndian(EndianType _endian)
97  {
98  m_endian = _endian;
99  }
100 
104  off_t m_offset;
105  EndianType m_endian;
106  };
107 
108  }
109 }
110 
111 
112 #endif
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.
Definition: arwfile.cpp:33
size_t fetchData(void *buf, const off_t offset, const size_t buf_size)
bool readInt16(IO::Stream *f, int16_t &v)
RawContainer(IO::Stream *_file, off_t offset)
bool readUInt16(IO::Stream *f, uint16_t &v)
bool readInt32(IO::Stream *f, int32_t &v)
base virtual class for IO
Definition: stream.h:40
bool readUInt32(IO::Stream *f, uint32_t &v)