// PdbFinderWriter.hpp #if !defined(PDB_FINDER_WRITER_HPP) #define PDB_FINDER_WRITER_HPP #include #include #include #include #include "Parser.hpp" #include "PdbSeqresParser.hpp" #include "Reader.hpp" namespace NGBW { struct ChainComparator : public std::binary_function { // a less-than operator bool operator()(const PdbSeqresRecord &left, const PdbSeqresRecord &right) const throw() { return left.chain_id.compare(right.chain_id) < 0; } }; typedef std::set ChainSet; typedef std::map SeqresMap; class PdbFinderWriter : public Parser { public: PdbFinderWriter(Reader &input, std::ostream &output) throw() : Parser(input), m_output(output) { m_output.exceptions(std::ios_base::badbit); } ~PdbFinderWriter() throw() { } void Write(const SeqresMap &sequences) throw(std::ios_base::failure); private: void ParseChain(const ChainSet &chains); void GetFieldValue(size_t offset, std::string &value); bool FindEndToken(); std::ostream &m_output; }; } // namespace NGBW #endif // PDB_FINDER_WRITER_HPP