From 4422ab97c43e13735d274219a2957aae7ec60d76 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 20 Mar 2018 14:42:22 +0100 Subject: Stop using fprintf in input information --- src/InputFileReader.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/InputFileReader.cpp') diff --git a/src/InputFileReader.cpp b/src/InputFileReader.cpp index 5d4d113..5a9780b 100644 --- a/src/InputFileReader.cpp +++ b/src/InputFileReader.cpp @@ -190,31 +190,31 @@ int InputFileReader::IdentifyType() return -1; } -void InputFileReader::PrintInfo() const +std::string InputFileReader::GetPrintableInfo() const { - fprintf(stderr, "Input file format: "); + std::string info = "Input file format: "; switch (streamtype_) { case EtiStreamType::Raw: - fprintf(stderr, "raw"); + info += "raw"; break; case EtiStreamType::Streamed: - fprintf(stderr, "streamed"); + info += "streamed"; break; case EtiStreamType::Framed: - fprintf(stderr, "framed"); + info += "framed"; break; default: - fprintf(stderr, "unknown!"); + info += "unknown!"; break; } - fprintf(stderr, "\n"); - fprintf(stderr, "Input file length: %zu\n", inputfilelength_); + info += ", length: " + std::to_string(inputfilelength_); if (~nbframes_ != 0) { - fprintf(stderr, "Input file nb frames: %lu\n", nbframes_); + info += ", nb frames: " + std::to_string(nbframes_); } else { - fprintf(stderr, "Input file nb frames: endless\n"); + info += ", nb frames: endless"; } + return info; } int InputFileReader::GetNextFrame(void* buffer) -- cgit v1.2.3