// 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;
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;
}
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 );
}