libopenraw  0.3.7
makernotedir.hpp
1 /*
2  * libopenraw - makernotedir.h
3  *
4  * Copyright (C) 2010-2020 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 #pragma once
23 
24 #include <stddef.h>
25 #include <sys/types.h>
26 #include <memory>
27 #include <string>
28 
29 #include "ifddir.hpp"
30 
31 namespace OpenRaw {
32 namespace Internals {
33 
34 class RawContainer;
35 
37  : public IfdDir
38 {
39 public:
40  typedef std::shared_ptr<MakerNoteDir> Ref;
41 
43  static Ref createMakerNote(off_t offset,
45 
46  MakerNoteDir(IfdDir& ifd, const std::string& id, const TagTable& tag_table);
47  MakerNoteDir(off_t _offset, RawContainer& _container,
48  off_t mnote_offset, const std::string & id,
49  const TagTable& tag_table);
50  virtual ~MakerNoteDir();
51 
54  IfdDir::Ref getIfdInEntry(uint16_t id);
55 
56  off_t getMnoteOffset() const
57  { return m_mnote_offset; }
58 
59  const std::string & getId() const
60  { return m_id; }
61 protected:
62  MakerNoteDir(const char* magic, size_t hlen,
63  off_t _offset,
64  RawContainer& _container,
65  off_t mnote_offset,
66  const std::string & id,
67  const TagTable& tag_table);
68 
69  MakerNoteDir(RawContainer& _container, const std::string& id);
70  off_t m_mnote_offset;
71  std::string m_id;
72 };
73 
78  : public MakerNoteDir
79 {
80 public:
81  NonMakerNoteDir(RawContainer& _container, const std::string& id)
82  : MakerNoteDir(_container, id)
83  {}
84 
85  virtual bool load() override
86  { return true; }
87 };
88 
89 }
90 }
91 
92 /*
93  Local Variables:
94  mode:c++
95  c-file-style:"stroustrup"
96  c-file-offsets:((innamespace . 0))
97  indent-tabs-mode:nil
98  fill-column:80
99  End:
100 */
An IFD directory.
Definition: ifddir.hpp:51
const RawContainer & container() const
The container for the IfdDir, const.
Definition: ifddir.hpp:108
std::shared_ptr< IfdDir > Ref
Shared ptr of an IfdDir.
Definition: ifddir.hpp:56
off_t offset() const
Return the offset.
Definition: ifddir.hpp:106
IfdDir::Ref getIfdInEntry(uint16_t id)
static Ref createMakerNote(off_t offset, RawContainer &container, or_rawfile_type file_type)
virtual bool load() override
Load the directory to memory.
Generic interface for the RAW file container.
or_rawfile_type
Types of RAW files.
Definition: consts.h:59
Global namespace for libopenraw.
Definition: arwfile.cpp:29