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-timestamp.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'apps/sample-timestamp.cpp') diff --git a/apps/sample-timestamp.cpp b/apps/sample-timestamp.cpp index dd9ab3c..4855506 100644 --- a/apps/sample-timestamp.cpp +++ b/apps/sample-timestamp.cpp @@ -81,7 +81,7 @@ public: now_key = dict.indexOf(now_name); auto sample_buffer = make_shared(); - unique_ptr parser = open_sample_input_stream(dict, sample_buffer); + auto parser = open_sample_input_stream(sample_buffer, dict); while (!input.fail()) { char buffer[buffer_size]; input.read(buffer, buffer_size); @@ -129,9 +129,10 @@ public: return EXIT_FAILURE; } - auto output_stream = open_sample_output_stream(unique_ptr(&cout), dict, parser->type()); - auto p = make_shared(move(output_stream), dict, "timestamp", now_name, start_time); - parser = open_sample_input_stream(dict, p, parser->type()); + unique_ptr unique_output_stream = open_sample_output_stream(shared_ptr(&cout, noop_deleter), dict, parser->type()); + shared_ptr output_stream{std::move(unique_output_stream)}; + auto p = make_shared(output_stream, dict, timestamp_name, now_name, start_time); + parser = open_sample_input_stream(p, dict, parser->type()); int recordCount = 0; @@ -147,7 +148,7 @@ public: } return EXIT_SUCCESS; - } + }; }; } -- cgit v1.2.3