X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2FSamHeader.cpp;h=967957ac15dde882fd56677553fd6389afcacfa6;hb=76bb08a359f3974eee3e96327b965ccf7958ed1a;hp=363fb5ce18fa1579cee6885351a1eb2d969cad44;hpb=8a90b7aefffaf186053ef4da96c8663bf528274a;p=bamtools.git diff --git a/src/api/SamHeader.cpp b/src/api/SamHeader.cpp index 363fb5c..967957a 100644 --- a/src/api/SamHeader.cpp +++ b/src/api/SamHeader.cpp @@ -2,17 +2,17 @@ // SamHeader.cpp (c) 2010 Derek Barnett // Marth Lab, Department of Biology, Boston College // --------------------------------------------------------------------------- -// Last modified: 6 October 2011 (DB) +// Last modified: 25 October 2011 (DB) // --------------------------------------------------------------------------- // Provides direct read/write access to the SAM header data fields. // *************************************************************************** -#include -#include -#include -#include -#include -#include +#include "api/SamConstants.h" +#include "api/SamHeader.h" +#include "api/internal/utils/BamException_p.h" +#include "api/internal/sam/SamFormatParser_p.h" +#include "api/internal/sam/SamFormatPrinter_p.h" +#include "api/internal/sam/SamHeaderValidator_p.h" using namespace BamTools; using namespace BamTools::Internal; using namespace std; @@ -27,7 +27,7 @@ using namespace std; /*! \var SamHeader::Version \brief corresponds to \@HD VN:\ - Required for valid SAM header, if @HD record is present. + Required for valid SAM header, if \@HD record is present. */ /*! \var SamHeader::SortOrder \brief corresponds to \@HD SO:\ @@ -43,14 +43,9 @@ using namespace std; \brief corresponds to \@RG entries \sa SamReadGroup, SamReadGroupDictionary */ -/*! \var SamHeader::ProgramName - \brief corresponds to \@PG ID:\ -*/ -/*! \var SamHeader::ProgramVersion - \brief corresponds to \@PG VN:\ -*/ -/*! \var SamHeader::ProgramCommandLine - \brief corresponds to \@PG CL:\ +/*! \var SamHeader::Programs + \brief corresponds to \@PG entries + \sa SamProgram, SamProgramChain */ /*! \var SamHeader::Comments \brief corresponds to \@CO entries @@ -77,6 +72,7 @@ SamHeader::SamHeader(const SamHeader& other) , Sequences(other.Sequences) , ReadGroups(other.ReadGroups) , Programs(other.Programs) + , Comments(other.Comments) { } /*! \fn SamHeader::~SamHeader(void) @@ -103,7 +99,12 @@ void SamHeader::Clear(void) { } /*! \fn std::string SamHeader::GetErrorString(void) const - \brief Returns human-readable description of last error encountered + \brief Returns a human-readable description of the last error that occurred + + This method allows elimination of STDERR pollution. Developers of client code + may choose how the messages are displayed to the user, if at all. + + \return error description */ std::string SamHeader::GetErrorString(void) const { return m_errorString; @@ -167,8 +168,9 @@ bool SamHeader::HasComments(void) const { /*! \fn bool SamHeader::IsValid(bool verbose = false) const \brief Checks header contents for required data and proper formatting. - \param verbose If set to true, validation errors & warnings will be printed to stderr. - Otherwise, messages are available through SamHeader::GetErrorString(). + + \param[in] verbose If set to true, validation errors & warnings will be printed to stderr. + Otherwise, messages are available through SamHeader::GetErrorString(). \return \c true if SAM header is well-formed */ bool SamHeader::IsValid(bool verbose) const { @@ -198,7 +200,8 @@ bool SamHeader::IsValid(bool verbose) const { /*! \fn void SamHeader::SetHeaderText(const std::string& headerText) \brief Replaces header contents with \a headerText. - \param headerText SAM formatted-text that will be parsed into data fields + + \param[in] headerText SAM formatted-text that will be parsed into data fields */ void SamHeader::SetHeaderText(const std::string& headerText) {