]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/api/BamAux.h
Large-scale API indexing re-organization:
[bamtools.git] / src / api / BamAux.h
index 73e88381b695751473eba93098f4f3cdea5192e5..25f4538982b8393ac74cdd1bb7aa3943ea21a2f8 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