]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/io/BamPipe_p.cpp
Updated file headers (filename, license, description, etc)
[bamtools.git] / src / api / internal / io / BamPipe_p.cpp
index 40f1e100229a9c8ca70569df8b8a783b91106f7e..2d571fd4c2500adbce043f59065a80f3ddc1efad 100644 (file)
@@ -2,7 +2,7 @@
 // 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
 // ***************************************************************************
@@ -34,14 +34,18 @@ bool BamPipe::Open(const IBamIODevice::OpenMode mode) {
     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;
     }
@@ -51,7 +55,7 @@ bool BamPipe::Open(const IBamIODevice::OpenMode mode) {
     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;
 }