Skip to content

Commit 726d2c6

Browse files
author
ironholds
committed
argh
1 parent 42822bd commit 726d2c6

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

src/exif_bindings.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include "exif_bindings.h"
2+
3+
exif_bindings::exif_bindings(){
4+
ExifTag tag;
5+
int tag_length = exif_tag_table_count();
6+
const char * holding;
7+
std::vector < std::string > names_(tag_length);
8+
9+
for(int i = 0; i < tag_length; i++){
10+
tag = exif_tag_table_get_tag(i);
11+
holding = exif_tag_get_title(tag);
12+
if(!holding){
13+
names_[i] = "";
14+
} else {
15+
names_[i] = std::string(holding);
16+
}
17+
}
18+
names = names_;
19+
}
20+
21+
std::vector < std::string > exif_bindings::get_names(){
22+
return names;
23+
}

src/exif_bindings.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <Rcpp.h>
2+
#include <libexif/exif-data.h>
3+
using namespace Rcpp;
4+
5+
#ifndef __EXIF_BINDINGS__
6+
#define __EXIF_BINDINGS__
7+
8+
class exif_bindings {
9+
10+
private:
11+
12+
std::vector < std::string > names;
13+
14+
public:
15+
16+
/**
17+
* Constructor for populating names and descriptions.
18+
*/
19+
exif_bindings();
20+
21+
std::vector < std::string > get_names();
22+
};
23+
24+
#endif

0 commit comments

Comments
 (0)