]> git.datanom.net - lensdb.git/blob - lib/scanner.cpp
Release 0.9.2
[lensdb.git] / lib / scanner.cpp
1 /*
2 * scanner.cpp
3 *
4 * Copyright 2024 Michael Rasmussen <mir@datanom.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program 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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 *
21 *
22 */
23
24 #include <stdlib.h>
25 #include "main.hpp"
26 #include "scanner.h"
27
28 struct Scanner {
29 void* obj;
30 };
31
32 Scanner_t* scanner_create(const char* file) {
33 Scanner_t* s;
34 ExifScanner* obj;
35
36 s = g_new0(Scanner_t, 1);
37 obj = new ExifScanner(file);
38 s->obj = obj;
39
40 return s;
41 }
42
43 void scanner_destroy(Scanner_t* s) {
44 if (s == NULL)
45 return;
46
47 delete static_cast<ExifScanner *>(s->obj);
48 free(s);
49 }
50
51 gchar* get_lens_maker(Scanner_t* s) {
52 ExifScanner* obj;
53
54 if (s == NULL)
55 return NULL;
56
57 obj = static_cast<ExifScanner *>(s->obj);
58 return obj->get_cscring(obj->get_maker());
59 }
60
61 gchar* get_lens_serial_number(Scanner_t* s) {
62 ExifScanner* obj;
63
64 if (s == NULL)
65 return NULL;
66
67 obj = static_cast<ExifScanner *>(s->obj);
68 return obj->get_cscring(obj->get_serial_number());
69 }
70
71 gchar* get_lens_info(Scanner_t* s) {
72 ExifScanner* obj;
73
74 if (s == NULL)
75 return NULL;
76
77 obj = static_cast<ExifScanner *>(s->obj);
78 return obj->get_cscring(obj->get_lens());
79 }
This page took 0.502828 seconds and 6 git commands to generate.