From 7edc4328bfd5eee557108ebdb4243ca06914c41e Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 17 Mar 2015 22:56:47 +0100 Subject: o cout and unique_ptr became complicated. o Updating lots of code to the latest api. --- apps/sample-convert.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/sample-convert.cpp') diff --git a/apps/sample-convert.cpp b/apps/sample-convert.cpp index 5e87a15..c5e9c4f 100644 --- a/apps/sample-convert.cpp +++ b/apps/sample-convert.cpp @@ -49,11 +49,11 @@ public: } } - unique_ptr outputStream; + shared_ptr outputStream; if (output_file == "-") { - outputStream = unique_ptr(&cout); + outputStream = shared_ptr(&cout, noop_deleter); } else { - outputStream = make_unique(output_file); + outputStream = make_shared(output_file); if (outputStream->fail()) { cerr << "Unable to open output file " << output_file << endl; return EXIT_FAILURE; @@ -61,16 +61,18 @@ public: } if (output_format == "plain") { - output = make_shared(move(outputStream), dict); + output = make_shared(outputStream, dict); } else if (output_format == "json") { - output = make_shared(move(outputStream), dict); + output = make_shared(outputStream, dict); } else if (output_format == "sql") { if (table_name.size() == 0) { cerr << "Missing option: table-name" << endl; return EXIT_FAILURE; } - output = make_shared(move(outputStream), dict, table_name); + output = make_shared(outputStream, dict, table_name); + } else if (output_format == "csv") { + output = make_shared(outputStream, dict); } else { cerr << "Unsupported output format: " << output_format << endl; return EXIT_FAILURE; -- cgit v1.2.3