forked from Ironholds/olctools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate.h
More file actions
57 lines (38 loc) · 1020 Bytes
/
validate.h
File metadata and controls
57 lines (38 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <Rcpp.h>
using namespace Rcpp;
#ifndef __OLC_VALIDATE__
#define __OLC_VALIDATE__
class olc_validate {
protected:
/**
* Valid characters for an OLC to have. Basically the character set and + or 0.
*/
std::string valid_chars;
/**
* The separator character for an OLC
*/
std::string separator;
/**
* Where in the OLC the separator character should appear.
*/
unsigned int separator_position;
/**
* The padding character (0).
*/
std::string padding;
std::string character_set;
int charset_length;
int max_latitude;
int max_longitude;
bool olc_check_full_single(std::string olc);
bool olc_check_short_single(std::string olc);
private:
bool olc_check_single(std::string olc);
bool olc_check_either_single(std::string olc);
public:
LogicalVector olc_check_full_vector(CharacterVector olc);
LogicalVector olc_check_short_vector(CharacterVector olc);
LogicalVector olc_check_either_vector(CharacterVector olc);
olc_validate();
};
#endif