X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2Finternal%2FSamFormatPrinter_p.cpp;h=942a7af7bc9706d509ffc21123a66c5c91ca8dbe;hb=9f1ce8c47aeadb6dc1320b52ee671c3341b97935;hp=df13fe55b9419cfc1eb19aee3ec9c68b8c4eb274;hpb=1a93ff03d7e40d97c32e6f5966045ceaeb2f038a;p=bamtools.git diff --git a/src/api/internal/SamFormatPrinter_p.cpp b/src/api/internal/SamFormatPrinter_p.cpp index df13fe5..942a7af 100644 --- a/src/api/internal/SamFormatPrinter_p.cpp +++ b/src/api/internal/SamFormatPrinter_p.cpp @@ -2,14 +2,14 @@ // SamFormatPrinter.cpp (c) 2010 Derek Barnett // Marth Lab, Department of Biology, Boston College // --------------------------------------------------------------------------- -// Last modified: 19 April 2011 (DB) +// Last modified: 10 October 2011 (DB) // --------------------------------------------------------------------------- // Provides functionality for printing formatted SAM header to string // *************************************************************************** -#include -#include -#include +#include "api/SamConstants.h" +#include "api/SamHeader.h" +#include "api/internal/SamFormatPrinter_p.h" using namespace BamTools; using namespace BamTools::Internal; @@ -18,16 +18,25 @@ using namespace BamTools::Internal; #include using namespace std; +// ------------------------ +// static utility methods +// ------------------------ + +static inline +const string FormatTag(const string& tag, const string& value) { + return string(Constants::SAM_TAB + tag + Constants::SAM_COLON + value); +} + +// --------------------------------- +// SamFormatPrinter implementation +// --------------------------------- + SamFormatPrinter::SamFormatPrinter(const SamHeader& header) : m_header(header) { } SamFormatPrinter::~SamFormatPrinter(void) { } -const string SamFormatPrinter::FormatTag(const string &tag, const string &value) const { - return string(Constants::SAM_TAB + tag + Constants::SAM_COLON + value); -} - const string SamFormatPrinter::ToString(void) const { // clear out stream