// BamPipe_p.cpp (c) 2011 Derek Barnett
// Marth Lab, Department of Biology, Boston College
// ---------------------------------------------------------------------------
-// Last modified: 25 October 2011 (DB)
+// Last modified: 10 November 2011 (DB)
// ---------------------------------------------------------------------------
// Provides BAM pipe-specific IO behavior
// ***************************************************************************
else if ( mode == IBamIODevice::WriteOnly )
m_stream = freopen(0, "wb", stdout);
else {
- SetErrorString("BamPipe::Open", "unknown open mode requested");
+ const string errorType = string( (mode == IBamIODevice::ReadWrite) ? "unsupported"
+ : "unknown" );
+ const string message = errorType + " open mode requested";
+ SetErrorString("BamPipe::Open", message);
return false;
}
// check that we obtained a valid FILE*
if ( m_stream == 0 ) {
const string message_base = string("could not open handle on ");
- const string message = message_base + ( (mode == IBamIODevice::ReadOnly) ? "stdin" : "stdout" );
+ const string message = message_base + ( (mode == IBamIODevice::ReadOnly) ? "stdin"
+ : "stdout" );
SetErrorString("BamPipe::Open", message);
return false;
}
return true;
}
-bool BamPipe::Seek(const int64_t& ) {
+bool BamPipe::Seek(const int64_t&, const int) {
SetErrorString("BamPipe::Seek", "random access not allowed in FIFO pipe");
return false;
}