PDB record parsers

namespace mdk
namespace pdb
class RecordParser
#include <RecordParsers.hpp>

A parser of a single record. Because of the “bidirectionality” of Field structures and ability to swap out the pointers, we can elegantly represent as a list of the fields in the line of a record, and the parsing and writing of the record are essentially provided out-of-the-box.

Subclassed by mdk::pdb::AtomParser, mdk::pdb::Cryst1Parser, mdk::pdb::EndParser, mdk::pdb::EndmdlParser, mdk::pdb::HetatmParser, mdk::pdb::LinkParser, mdk::pdb::ModelParser, mdk::pdb::RemarkParser, mdk::pdb::SSBondParser, mdk::pdb::TerParser

Public Functions

Record tryParse(std::string const &s) const

Try to parse a string into a PDB record. If unsuccessful, a std::monostate() is returned.

Parameters

sString to parse into a PDB record.

Returns

Either a parsed PDB record or a std::monostate() if the parsing was unsuccessful.

std::ostream &write(std::ostream &os, Record const &other)

Write out the record (in the text form) to an output stream.

Parameters
  • os – Output stream to write the PDB record to.

  • other – PDB record to write to the stream.

Returns

os

Public Members

std::vector<std::shared_ptr<Field>> fields

A list of fields comprising the record.

Protected Attributes

Record record

Underlying record, which serves as a base of variable (integers, strings etc. of a record) to which field parsers write parsed values and from which the field parsers read the values to write.

class RemarkParser : public mdk::pdb::RecordParser

Public Functions

RemarkParser()
class AtomParser : public mdk::pdb::RecordParser

Public Functions

AtomParser()
class HetatmParser : public mdk::pdb::RecordParser

Public Functions

HetatmParser()
class SSBondParser : public mdk::pdb::RecordParser

Public Functions

SSBondParser()
class Cryst1Parser : public mdk::pdb::RecordParser

Public Functions

Cryst1Parser()
class LinkParser : public mdk::pdb::RecordParser

Public Functions

LinkParser()
class ModelParser : public mdk::pdb::RecordParser

Public Functions

ModelParser()
class EndmdlParser : public mdk::pdb::RecordParser

Public Functions

EndmdlParser()
class EndParser : public mdk::pdb::RecordParser

Public Functions

EndParser()
class TerParser : public mdk::pdb::RecordParser

Public Functions

TerParser()