NuriKit v0.1.0b2
Loading...
Searching...
No Matches
sdf.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_SDF_H_
7#define NURI_FMT_SDF_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_sdf(const std::vector<std::string> &sdf);
27
28class SDFReader final: public DefaultReaderImpl<read_sdf> {
29public:
31
32 bool getnext(std::vector<std::string> &block) override;
33
34 bool bond_valid() const override { return true; }
35};
36
38private:
39 static const bool kRegistered ABSL_ATTRIBUTE_UNUSED;
40};
41
47
59extern bool write_sdf(std::string &out, const Molecule &mol, int conf = -1,
61} // namespace nuri
62
63#endif /* NURI_FMT_SDF_H_ */
Definition base.h:238
Read-only molecule class.
Definition molecule.h:943
Definition sdf.h:37
Definition sdf.h:28
bool getnext(std::vector< std::string > &block) override
Advance the reader to the next molecule.
bool bond_valid() const override
Test whether the reader implementation can provide valid bond information.
Definition sdf.h:34
Definition crdgen.h:16
SDFVersion
Definition sdf.h:42
@ kAutomatic
Definition sdf.h:43
@ kV2000
Definition sdf.h:44
@ kV3000
Definition sdf.h:45
Molecule read_sdf(const std::vector< std::string > &sdf)
Read a single sdf string and return a molecule.
bool write_sdf(std::string &out, const Molecule &mol, int conf=-1, SDFVersion ver=SDFVersion::kAutomatic)
Write a molecule to an SDF stream.