#include <makernote.hpp>
Collaboration diagram for Exiv2::MakerNoteFactory:
Static Public Member Functions | |
static void | cleanup () |
Destructor. | |
static void | registerMakerNote (const std::string &make, const std::string &model, CreateFct createMakerNote) |
Register a MakerNote create function for a camera make and model. | |
static void | registerMakerNote (IfdId ifdId, MakerNote::AutoPtr makerNote) |
Register a MakerNote prototype in the IFD id registry. | |
static MakerNote::AutoPtr | create (const std::string &make, const std::string &model, bool alloc, const byte *buf, long len, ByteOrder byteOrder, long offset) |
Create the appropriate MakerNote based on camera make and model and possibly the contents of the makernote itself, return an auto-pointer to the newly created MakerNote instance. Return 0 if no MakerNote is defined for the camera model. | |
static MakerNote::AutoPtr | create (IfdId ifdId, bool alloc=true) |
Create a MakerNote for an IFD id. | |
static int | match (const std::string ®Entry, const std::string &key) |
Match a registry entry with a key (used for make and model). | |
Classes | |
class | Init |
Class Init is used to execute initialisation and termination code exactly once, at the begin and end of the program. More... |
Maintains an associative list (tree) of camera makes/models and corresponding MakerNote create functions. Creates an instance of the MakerNote for one camera make/model. The factory is implemented as a static class.
|
Create the appropriate MakerNote based on camera make and model and possibly the contents of the makernote itself, return an auto-pointer to the newly created MakerNote instance. Return 0 if no MakerNote is defined for the camera model. The method searches the make-model tree for a make and model combination in the registry that matches the search key. The search is case insensitive (Todo: implement case-insensitive comparisons) and wildcards in the registry entries are supported. First the best matching make is searched, then the best matching model for this make is searched. If there is no matching make or no matching model within the models registered for the best matching make, then no makernote is created and the function returns 0. If a match is found, the function invokes the registered create function and returns an auto-pointer to the newly created MakerNote. The makernote pointed to is owned by the caller of the function and the auto-pointer ensures that it is deleted. The best match is an exact match, then a match is rated according to the number of matching characters. The makernote buffer is passed on to the create function, which can based on its content, automatically determine the correct version or flavour of the makernote required. This is used, e.g., to determine which of the three Nikon makernotes to create.
|
|
Match a registry entry with a key (used for make and model). The matching algorithm is case insensitive and wildcards ('*') in the registry entry are supported. The best match is an exact match, then a match is rated according to the number of matching characters.
|
|
Register a MakerNote create function for a camera make and model. Registers a create function for a MakerNote for a given make and model combination with the factory. Both the make and model strings may contain wildcards ('*', e.g., "Canon*"). If the make already exists in the registry, then a new branch for the model is added. If the model also already exists, then the new create function replaces the old one.
|