SamProgram.h

Go to the documentation of this file.
00001 // ***************************************************************************
00002 // SamProgram.h (c) 2011 Derek Barnett
00003 // Marth Lab, Department of Biology, Boston College
00004 // ---------------------------------------------------------------------------
00005 // Last modified: 10 October 2011 (DB)
00006 // ---------------------------------------------------------------------------
00007 // Provides direct read/write access to the SAM header program records.
00008 // ***************************************************************************
00009 
00010 #ifndef SAM_PROGRAM_H
00011 #define SAM_PROGRAM_H
00012 
00013 #include "api/api_global.h"
00014 #include <string>
00015 
00016 namespace BamTools {
00017 
00018 class SamProgramChain;
00019 
00020 struct API_EXPORT SamProgram {
00021 
00022     // ctor & dtor
00023     SamProgram(void);
00024     SamProgram(const std::string& id);
00025     SamProgram(const SamProgram& other);
00026     ~SamProgram(void);
00027 
00028     // query/modify entire program record
00029     void Clear(void);                      // clears all data fields
00030 
00031     // convenience query methods
00032     bool HasCommandLine(void) const;       // returns true if program record has a command line entry
00033     bool HasID(void) const;                // returns true if program record has an ID
00034     bool HasName(void) const;              // returns true if program record has a name
00035     bool HasPreviousProgramID(void) const; // returns true if program record has a 'previous program ID'
00036     bool HasVersion(void) const;           // returns true if program record has a version
00037 
00038     // data members
00039     std::string CommandLine;               // CL:<CommandLine>
00040     std::string ID;                        // ID:<ID>          *Required for valid SAM header*
00041     std::string Name;                      // PN:<Name>
00042     std::string PreviousProgramID;         // PP:<PreviousProgramID>
00043     std::string Version;                   // VN:<Version>
00044 
00045     // internal (non-standard) methods & fields
00046     private:
00047         bool HasNextProgramID(void) const;
00048         std::string NextProgramID;
00049         friend class BamTools::SamProgramChain;
00050 };
00051 
00055 API_EXPORT inline bool operator==(const SamProgram& lhs, const SamProgram& rhs) {
00056     return lhs.ID == rhs.ID;
00057 }
00058 
00059 } // namespace BamTools
00060 
00061 #endif // SAM_PROGRAM_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Aug 29 17:43:46 2012 for BamTools by  doxygen 1.6.3