X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FBamAux.h;h=7a7fb1c00ab96299eb378dccfa6952aaeb5e9d24;hb=90bb3691f9aa2a2e8a4dd906c2439c7bc434eb78;hp=a39abb07da19a2cc2c6e8daabd7caa1c072a6f3b;hpb=1ee9b6b3d98a4bfd5a60c583bc7847c545a60e32;p=bamtools.git diff --git a/src/api/BamAux.h b/src/api/BamAux.h index a39abb0..7a7fb1c 100644 --- a/src/api/BamAux.h +++ b/src/api/BamAux.h @@ -3,7 +3,7 @@ // Marth Lab, Department of Biology, Boston College // All rights reserved. // --------------------------------------------------------------------------- -// Last modified: 27 July 2010 (DB) +// Last modified: 3 September 2010 (DB) // --------------------------------------------------------------------------- // Provides the basic constants, data structures, etc. for using BAM files // *************************************************************************** @@ -19,6 +19,8 @@ // C++ includes #include +#include +#include #include #include #include @@ -350,6 +352,11 @@ inline void SwapEndian_64p(char* data) { SwapEndian_64(value); } +inline bool FileExists(const std::string& filename) { + std::ifstream f(filename.c_str(), std::ifstream::in); + return !f.fail(); +} + // ---------------------------------------------------------------- // BamAlignment member methods