13 const std::string &command,
14 std::istream ¶meters,
19 if (command ==
"help")
23 timestamp [<stamp>] (if no value is given, use current time)
24 comment "<comment_string>"
27 checkpoint [no|half|full]
28 write_blob <data_string>
34 else if (command ==
"comment")
36 const std::string comment =
read_string(parameters);
37 writable.comment(comment);
39 else if (command ==
"timestamp")
41 int64_t timestamp = 0;
42 parameters >> timestamp;
43 if (parameters.fail())
44 timestamp = std::time(
nullptr);
45 writable.timestamp(timestamp);
47 else if (command ==
"valid_data")
49 writable.valid_data();
51 else if (command ==
"flush")
55 else if (command ==
"checkpoint")
62 else if (param ==
"half")
64 else if (param ==
"full")
66 else if (param.empty())
67 writable.default_checkpoint();
69 out <<
"Error: unknown parameter: " << param <<
'\n';
71 else if (command ==
"write_blob")
74 const Blob blob = blob_writer.write_blob_data(value);
79 return Status::not_found;
void write_blob(std::ostream &out, Blob blob)
std::string read_string(std::istream &in)