Pteros  2.0
Molecular modeling library for human beings!
pttop_file.h
1 /*
2  *
3  * This source code is part of
4  * ******************
5  * *** Pteros ***
6  * ******************
7  * molecular modeling library
8  *
9  * Copyright (c) 2009-2013, Semen Yesylevskyy
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of Artistic License:
13  *
14  * Please note, that Artistic License is slightly more restrictive
15  * then GPL license in terms of distributing the modified versions
16  * of this software (they should be approved first).
17  * Read http://www.opensource.org/licenses/artistic-license-2.0.php
18  * for details. Such license fits scientific software better then
19  * GPL because it prevents the distribution of bugged derivatives.
20  *
21 */
22 
23 #ifndef PTTOP_FILE_H
24 #define PTTOP_FILE_H
25 
26 #include "pteros/core/mol_file.h"
27 
28 namespace pteros {
29 
30 
31 class PTTOP_file: public Mol_file {
32 public:
33  PTTOP_file(std::string& fname): Mol_file(fname) {}
34  virtual void open(char open_mode);
35  ~PTTOP_file();
36 
37  virtual Mol_file_content get_content_type() const {
38  return MFC_ATOMS | MFC_COORD | MFC_TOP;
39  }
40 
41 protected:
42 
43  virtual void do_write(const Selection &sel, const Mol_file_content& what) {}
44 
45  virtual bool do_read(System *sys, Frame *frame, const Mol_file_content& what);
46 
47  std::string file_name;
48  char open_mode;
49 };
50 
51 }
52 #endif /* MOL_FILE_H */
Pteros namespace.
Definition: options.cpp:32
static std::unique_ptr< Mol_file > open(std::string fname, char open_mode)
Recognize file extension, open file for reading or writing and return a file handler.
Definition: mol_file.cpp:142