1 // ***************************************************************************
2 // BamIndexFactory_p.h (c) 2011 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 26 January 2011 (DB)
7 // ---------------------------------------------------------------------------
8 // Provides interface for generating BamIndex implementations
9 // ***************************************************************************
11 #ifndef BAMINDEX_FACTORY_P_H
12 #define BAMINDEX_FACTORY_P_H
14 #include <api/BamIndex.h>
20 class BamIndexFactory {
22 // static interface methods
24 // creates a new BamIndex object, depending on extension of @indexFilename
25 static BamIndex* CreateIndexFromFilename(const std::string& indexFilename);
26 // creates a new BamIndex object, of requested @type
27 static BamIndex* CreateIndexOfType(const BamIndex::IndexType& type);
28 // returns name of existing index file that corresponds to @bamFilename
29 // will defer to @preferredType if possible
30 // if @preferredType not found, will attempt to load any supported index type
31 // returns empty string if no index file (of any type) is found
32 static const std::string FindIndexFilename(const std::string& bamFilename,
33 const BamIndex::IndexType& preferredType);
37 // generates index filename from BAM filename (depending on requested type)
38 // if type is unknown, returns empty string
39 static const std::string CreateIndexFilename(const std::string& bamFilename,
40 const BamIndex::IndexType& type);
41 // retrieves file extension (including '.')
42 static const std::string FileExtension(const std::string& filename);
45 } // namespace Internal
46 } // namespace BamTools
48 #endif // BAMINDEX_FACTORY_P_H