X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fapi%2Finternal%2FSamFormatPrinter_p.cpp;h=942a7af7bc9706d509ffc21123a66c5c91ca8dbe;hb=9f1ce8c47aeadb6dc1320b52ee671c3341b97935;hp=1e670b0155be479d88d9ed6d21b1c406600313af;hpb=cdf4bbcb19025398d429035fe672661a8c8d1a80;p=bamtools.git diff --git a/src/api/internal/SamFormatPrinter_p.cpp b/src/api/internal/SamFormatPrinter_p.cpp index 1e670b0..942a7af 100644 --- a/src/api/internal/SamFormatPrinter_p.cpp +++ b/src/api/internal/SamFormatPrinter_p.cpp @@ -1,16 +1,15 @@ // *************************************************************************** // SamFormatPrinter.cpp (c) 2010 Derek Barnett // Marth Lab, Department of Biology, Boston College -// All rights reserved. // --------------------------------------------------------------------------- -// 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; @@ -19,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