NuriKit v0.1.0b2
Loading...
Searching...
No Matches
mol2.h
Go to the documentation of this file.
1//
2// Project NuriKit - Copyright 2023 SNU Compbio Lab.
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef NURI_FMT_MOL2_H_
7#define NURI_FMT_MOL2_H_
8
10#include <string>
11#include <vector>
12
13#include <absl/base/attributes.h>
15
16#include "nuri/core/molecule.h"
17#include "nuri/fmt/base.h"
18
19namespace nuri {
26extern Molecule read_mol2(const std::vector<std::string> &mol2);
27
28class Mol2Reader final: public DefaultReaderImpl<read_mol2> {
29public:
31
32 bool getnext(std::vector<std::string> &block) override;
33
34 bool bond_valid() const override { return true; }
35
36private:
37 bool read_mol_header_ = false;
38};
39
41private:
42 static const bool kRegistered ABSL_ATTRIBUTE_UNUSED;
43};
44
45extern bool write_mol2(std::string &out, const Molecule &mol, int conf = -1,
46 bool write_sub = true);
47} // namespace nuri
48
49#endif /* NURI_FMT_MOL2_H_ */
Definition base.h:238
Definition mol2.h:40
Definition mol2.h:28
bool bond_valid() const override
Test whether the reader implementation can provide valid bond information.
Definition mol2.h:34
bool getnext(std::vector< std::string > &block) override
Advance the reader to the next molecule.
Read-only molecule class.
Definition molecule.h:943
Definition crdgen.h:16
Molecule read_mol2(const std::vector< std::string > &mol2)
Read a single Mol2 string and return a molecule.
bool write_mol2(std::string &out, const Molecule &mol, int conf=-1, bool write_sub=true)