23 #ifndef _PROTEOME_TEXTWRITER_HPP_
24 #define _PROTEOME_TEXTWRITER_HPP_
29 #include "boost/lexical_cast.hpp"
44 :
os_(os), depth_(depth), indent_(depth*2,
' ')
51 os_ << indent_ << text << std::endl;
55 template<
typename object_type>
56 TextWriter& operator()(
const std::string& label,
const std::vector<object_type>& v)
59 for_each(v.begin(), v.end(), child());
66 (*this)(
"ProteomeData:");
83 (
"sequence: " + p.
sequence().substr(0, 10));
89 std::string text(
"proteinList (" + boost::lexical_cast<std::string>(proteinList.
size()) +
" proteins)");
96 for (
size_t index = 0; index < proteinList.
size(); ++index)
98 (*proteinList.
protein(index,
true));
103 template<
typename object_type>
104 TextWriter& operator()(
const boost::shared_ptr<object_type>& p)
106 return p.get() ? (*this)(*p) : *
this;
121 #endif // _PROTEOME_TEXTWRITER_HPP_