]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/internal/BamFile_p.cpp
Cleaned up intra-API includes & moved version numbers to 2.0.0
[bamtools.git] / src / api / internal / BamFile_p.cpp
index 6cb5be49845d445f04d0908f709027375c58ae6e..74c4ed68d559d30aee7cf243fc8bc042b21bb5ea 100644 (file)
@@ -2,12 +2,12 @@
 // BamFile_p.cpp (c) 2011 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 9 September 2011 (DB)
+// Last modified: 10 October 2011 (DB)
 // ---------------------------------------------------------------------------
 // Provides BAM file-specific IO behavior
 // ***************************************************************************
 
-#include <api/internal/BamFile_p.h>
+#include "api/internal/BamFile_p.h"
 using namespace BamTools;
 using namespace BamTools::Internal;
 
@@ -44,15 +44,15 @@ bool BamFile::Open(const IBamIODevice::OpenMode mode) {
     else if ( mode == IBamIODevice::WriteOnly )
         m_stream = fopen(m_filename.c_str(), "wb");
     else {
-        SetErrorString("BamFile ERROR - unknown device open mode");
+        SetErrorString("BamFile::Open", "unknown open mode requested");
         return false;
     }
 
     // check that we obtained a valid FILE*
     if ( m_stream == 0 ) {
-        string error = "BamFile ERROR - could not open handle on ";
-        error += ( (m_filename.empty()) ? "empty filename" : m_filename );
-        SetErrorString(error);
+        const string message_base = string("could not open file handle for ");
+        const string message = message_base + ( (m_filename.empty()) ? "empty filename" : m_filename );
+        SetErrorString("BamFile::Open", message);
         return false;
     }
 
@@ -63,6 +63,5 @@ bool BamFile::Open(const IBamIODevice::OpenMode mode) {
 
 bool BamFile::Seek(const int64_t& position) {
     BT_ASSERT_X( m_stream, "BamFile::Seek() - null stream" );
-    cerr << "BamFile::Seek() - about to attempt seek" << endl;
-    return ( fseek64(m_stream, position, SEEK_SET) == 0);
+    return ( fseek64(m_stream, position, SEEK_SET) == 0 );
 }