-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVoter.h
74 lines (59 loc) · 1.59 KB
/
Voter.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// Created by kwoodle on 2/5/18.
//
#ifndef VOTERDATA_VOTER_H
#define VOTERDATA_VOTER_H
#include<string>
#include <vector>
#include <json/reader.h>
#include <memory>
using JRdrPtr = std::unique_ptr<Json::CharReader>;
using std::string;
// std::unique_ptr passed by cons reference
//
bool not_valid_json(const JRdrPtr&, const string json, string& err);
using namespace std;
const string drop_vhist_json_test
{
R"%%(truncate table if exists test.HistoryJ;)%%"
};
const string create_vhist_json_test {R"%%(
create table test.HistoryJ(
LASTNAME varchar(50) not null,
SBOEID varchar(50) not null,
VoterHistory json,
foreign key (SBOEID) references test.SuffTest (SBOEID)
)
)%%"
};
const string drop_vhist_json
{
R"%%(truncate table if exists voting.HistoryJ;)%%"
};
const string create_vhist_json{R"%%(
create table voting.HistoryJ(
LASTNAME varchar(50) not null,
SBOEID varchar(50) not null,
VoterHistory json,
foreign key (SBOEID) references voting.Suffolk2018 (SBOEID)
)
)%%"
};
const string drop_Suffolk_test {R"%%(
truncate table if exists test.SuffTest;
)%%"
};
const string drop_Suffolk {R"%%(
truncate table if exists voting.Suffolk2018;
)%%"
};
// dates in voter record, change from 1 to zero based
// DOB - col17, LASTVOTEDDATE - col29, REGDATE - col 35,
// INACT_DATE - col41, PURGE_DATE - col42
const std::vector<int> idates{17, 29, 35, 41, 42};
bool is_date(const int dt);
void format_date(string&);
// don't create 0000-00-00
void form_date(string&);
//mysql_options(&mysql,MYSQL_INIT_COMMAND,"SET autocommit=0"); C API
#endif //VOTERDATA_VOTER_H