Pteros  2.0
Molecular modeling library for human beings!
pteros::Mol_file Class Referenceabstract

Generic API for reading and writing any molecule file formats. More...

#include <mol_file.h>

+ Inheritance diagram for pteros::Mol_file:

Public Member Functions

virtual void open (char open_mode)=0
 Opens a file with given access mode. Need to be defined by derived classes.
 
bool read (System *sys, Frame *frame, const Mol_file_content &what)
 Reads data, which are specified by what. More...
 
void write (const Selection &sel, const Mol_file_content &what)
 Write data from selection specidied by what.
 
virtual Mol_file_content get_content_type () const =0
 Reports content of this file type.
 

Static Public Member Functions

static std::unique_ptr< Mol_filerecognize (std::string fname)
 Recognizes file extension and returns a file handler.
 
static std::unique_ptr< Mol_fileopen (std::string fname, char open_mode)
 Recognize file extension, open file for reading or writing and return a file handler. More...
 

Detailed Description

Generic API for reading and writing any molecule file formats.

Member Function Documentation

std::unique_ptr< Mol_file > Mol_file::open ( std::string  fname,
char  open_mode 
)
static

Recognize file extension, open file for reading or writing and return a file handler.

This function is aquivalent to:

auto f = Mol_file::recognize(fname);
f.open(mode);
bool Mol_file::read ( System sys,
Frame frame,
const Mol_file_content &  what 
)

Reads data, which are specified by what.

Pointers to System and Frame could be nullptr if not used Returns true if read operation is succesfull and false if not.


The documentation for this class was generated from the following files: