]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamAux.h
Merge branch 'master' of git://github.com/pezmaster31/bamtools
[bamtools.git] / src / api / BamAux.h
index a39abb07da19a2cc2c6e8daabd7caa1c072a6f3b..7a7fb1c00ab96299eb378dccfa6952aaeb5e9d24 100644 (file)
@@ -3,7 +3,7 @@
 // Marth Lab, Department of Biology, Boston College\r
 // All rights reserved.\r
 // ---------------------------------------------------------------------------\r
-// Last modified: 27 July 2010 (DB)\r
+// Last modified: 3 September 2010 (DB)\r
 // ---------------------------------------------------------------------------\r
 // Provides the basic constants, data structures, etc. for using BAM files\r
 // ***************************************************************************\r
@@ -19,6 +19,8 @@
 \r
 // C++ includes\r
 #include <exception>\r
+#include <fstream>\r
+#include <iostream>\r
 #include <map>\r
 #include <string>\r
 #include <utility>\r
@@ -350,6 +352,11 @@ inline void SwapEndian_64p(char* data) {
     SwapEndian_64(value);\r
 }\r
 \r
+inline bool FileExists(const std::string& filename) {\r
+    std::ifstream f(filename.c_str(), std::ifstream::in);\r
+    return !f.fail();\r
+}\r
+\r
 // ----------------------------------------------------------------\r
 // BamAlignment member methods\r
 \r