// Marth Lab, Department of Biology, Boston College\r
// All rights reserved.\r
// ---------------------------------------------------------------------------\r
-// Last modified: 18 September 2010 (DB)\r
+// Last modified: 19 November 2010 (DB)\r
// ---------------------------------------------------------------------------\r
// Provides the basic constants, data structures, utilities etc. \r
// used throughout the API for handling BAM files\r
#ifndef BAMAUX_H\r
#define BAMAUX_H\r
\r
+#include <api/api_global.h>\r
+\r
#include <fstream> \r
#include <iostream>\r
#include <string>\r
#include <vector>\r
\r
-// ----------------------------------------------------------------\r
-// ----------------------------------------------------------------\r
-// Platform-specific type definitions\r
+// Platform-specific large-file support\r
+#ifndef BAMTOOLS_LFS\r
+#define BAMTOOLS_LFS\r
+ #ifdef WIN32\r
+ #define ftell64(a) _ftelli64(a)\r
+ #define fseek64(a,b,c) _fseeki64(a,b,c)\r
+ #else\r
+ #define ftell64(a) ftello(a)\r
+ #define fseek64(a,b,c) fseeko(a,b,c)\r
+ #endif\r
+#endif // BAMTOOLS_LFS\r
\r
+// Platform-specific type definitions\r
#ifndef BAMTOOLS_TYPES\r
#define BAMTOOLS_TYPES\r
#ifdef _MSC_VER\r
// Data structs & typedefs\r
\r
// CIGAR operation data structure\r
-struct CigarOp {\r
+struct API_EXPORT CigarOp {\r
\r
// data members\r
char Type; // Operation type (MIDNSHP)\r
};\r
\r
// Reference data entry\r
-struct RefData {\r
+struct API_EXPORT RefData {\r
\r
// data members\r
std::string RefName; // Name of reference sequence\r
typedef std::vector<RefData> RefVector;\r
\r
// General (sequential) genome region\r
-struct BamRegion {\r
+struct API_EXPORT BamRegion {\r
\r
// data members\r
int LeftRefID;\r
, RightPosition(rightPos)\r
{ }\r
\r
+ // copy constructor\r
+ BamRegion(const BamRegion& other)\r
+ : LeftRefID(other.LeftRefID)\r
+ , LeftPosition(other.LeftPosition)\r
+ , RightRefID(other.RightRefID)\r
+ , RightPosition(other.RightPosition)\r
+ { }\r
+ \r
// member functions\r
void clear(void) { LeftRefID = -1; LeftPosition = -1; RightRefID = -1; RightPosition = -1; }\r
bool isLeftBoundSpecified(void) const { return ( LeftRefID != -1 && LeftPosition != -1 ); }\r