libopenraw
file.hpp
1 /* -*- Mode: C++ -*- */
2 /*
3  * libopenraw - file.h
4  *
5  * Copyright (C) 2006-2016 Hubert Figuière
6  *
7  * This library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef OR_INTERNALS_IO_FILE_H_
23 #define OR_INTERNALS_IO_FILE_H_
24 
25 #include <stddef.h>
26 #include <sys/types.h>
27 
28 #include <libopenraw/io.h>
29 
30 #include "stream.hpp"
31 
32 namespace OpenRaw {
33 namespace IO {
34 
36 class File : public Stream {
37 public:
41  File(const char *filename);
42  virtual ~File();
43 
44  File(const File &f) = delete;
45  File &operator=(const File &) = delete;
46 
47  // file APIs
49  virtual Error open() override;
51  virtual int close() override;
53  virtual int seek(off_t offset, int whence) override;
55  virtual int read(void *buf, size_t count) override;
56  virtual off_t filesize() override;
57  //virtual void *mmap(size_t l, off_t offset) override;
58  //virtual int munmap(void *addr, size_t l) override;
59 
60 private:
62  ::io_methods *m_methods;
64  ::IOFileRef m_ioRef;
65 };
66 }
67 }
68 
69 #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:30
virtual int read(void *buf, size_t count) override
Definition: file.cpp:68
virtual int close() override
Definition: file.cpp:56
File(const char *filename)
Definition: file.cpp:33
virtual int seek(off_t offset, int whence) override
Definition: file.cpp:63
virtual Error open() override
Definition: file.cpp:47
base virtual class for IO
Definition: stream.hpp:41
Definition: io.h:38