Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
tools
fhicl-write-db.cc
Go to the documentation of this file.
1
#include <iostream>
2
3
#include "
fhiclcpp/DatabaseSupport.h
"
4
#include "sqlite3.h"
5
6
using namespace
std
;
7
8
int
9
main
(
int
argc,
char
*
argv
[])
10
{
11
if
(argc != 3) {
12
cerr << argv[0] <<
": two arguments required\n"
13
<<
"Usage: "
<< argv[0] <<
" fhicl-file database-file\n\n"
;
14
return
1;
15
}
16
17
char
const
* fhiclfile = argv[1];
18
char
const
* dbname = argv[2];
19
20
sqlite3
* db =
nullptr
;
21
22
int
rc
= sqlite3_open_v2(
23
dbname, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
nullptr
);
24
if
(rc != SQLITE_OK) {
25
cerr << argv[0] <<
": unable to open SQLite3 file "
<< dbname <<
'\n'
;
26
return
2;
27
}
28
29
fhicl::parse_file_and_fill_db
(fhiclfile, db);
30
rc = sqlite3_close(db);
31
if
(rc != SQLITE_OK) {
32
cerr << argv[0] <<
": failure closing SQLite file "
<< dbname
33
<<
"; file may be corrupt\n"
;
34
return
3;
35
}
36
37
return
0;
38
}
std
STL namespace.
fhicl::parse_file_and_fill_db
void parse_file_and_fill_db(std::string const &filename, sqlite3 *db)
Definition:
DatabaseSupport.cc:50
freeze_graph.argv
argv
Definition:
freeze_graph.py:218
python.emptydir.rc
rc
Definition:
emptydir.py:177
main
int main(int argc, char *argv[])
Definition:
fhicl-write-db.cc:9
sqlite3
struct sqlite3 sqlite3
Definition:
DatabaseSupport.h:12
DatabaseSupport.h
Generated by
1.8.11