12 static int joedb_to_json(
int argc,
char **argv)
17 std::cerr <<
"usage: " << argv[0] <<
" [--base64] <file.joedb>\n";
24 if (argc > 2 && argv[1] == std::string(
"--base64"))
31 Readonly_Journal journal(file);
33 journal.replay_log(db);
34 const int error =
write_json(std::cout, db, base64);
37 std::cerr <<
"warning: a string could not be encoded. Maybe you should use --base64 instead.\n";
40 std::cerr <<
"warning: inf or nan value encoded as 0. JSON does not support inf and nan.\n";
47int main(
int argc,
char **argv)
@ read_existing
fails if does not exist
int main_exception_catcher(int(*main)(int, char **), int argc, char **argv)
Catch exception from main.
int write_json(std::ostream &out, const Readable &db, bool base64)