| 1 |
/****************************************************************************** |
| 2 |
This source file is part of the Avogadro project. |
| 3 |
This source code is released under the 3-Clause BSD License, (see "LICENSE"). |
| 4 |
******************************************************************************/ |
| 5 |
|
| 6 |
#ifndef AVOGADRO_IO_SDFFORMAT_H |
| 7 |
#define AVOGADRO_IO_SDFFORMAT_H |
| 8 |
|
| 9 |
#include "fileformat.h" |
| 10 |
#include "mdlformat.h" |
| 11 |
|
| 12 |
namespace Avogadro { |
| 13 |
namespace Io { |
| 14 |
|
| 15 |
/** |
| 16 |
* @class SdfFormat sdfformat.h <avogadro/io/sdfformat.h> |
| 17 |
* @brief Implementation of the generic SDF format. |
| 18 |
* @author Marcus D. Hanwell |
| 19 |
* |
| 20 |
* Differs from the MDL / Mol format in that it includes properties |
| 21 |
* |
| 22 |
* Currently just supports V2000 of the format. |
| 23 |
*/ |
| 24 |
|
| 25 |
class AVOGADROIO_EXPORT SdfFormat : public MdlFormat |
| 26 |
{ |
| 27 |
public: |
| 28 |
SdfFormat(); |
| 29 |
~SdfFormat() override; |
| 30 |
|
| 31 |
Operations supportedOperations() const override |
| 32 |
{ |
| 33 |
return ReadWrite | MultiMolecule | File | Stream | String; |
| 34 |
} |
| 35 |
|
| 36 |
FileFormat* newInstance() const override { return new SdfFormat; } |
| 37 |
std::string identifier() const override { return "Avogadro: SDF"; } |
| 38 |
std::string name() const override { return "SDF"; } |
| 39 |
std::string description() const override |
| 40 |
{ |
| 41 |
return "Generic format that contains atoms, bonds, positions."; |
| 42 |
} |
| 43 |
|
| 44 |
std::string specificationUrl() const override |
| 45 |
{ |
| 46 |
return "https://web.archive.org/web/20210219065450/https://" |
| 47 |
"discover.3ds.com/sites/default/files/2020-08/" |
| 48 |
"biovia_ctfileformats_2020.pdf"; |
| 49 |
/* for previous (2011) version, see: |
| 50 |
https://web.archive.org/web/20180329184712/http://download.accelrys.com/freeware/ctfile-formats/ctfile-formats.zip |
| 51 |
*/ |
| 52 |
} |
| 53 |
|
| 54 |
std::vector<std::string> fileExtensions() const override; |
| 55 |
std::vector<std::string> mimeTypes() const override; |
| 56 |
|
| 57 |
[[nodiscard]] bool read(std::istream& in, Core::Molecule& molecule) override; |
| 58 |
[[nodiscard]] bool write(std::ostream& out, |
| 59 |
const Core::Molecule& molecule) override; |
| 60 |
}; |
| 61 |
|
| 62 |
} // namespace Io |
| 63 |
} // namespace Avogadro |
| 64 |
|
| 65 |
#endif // AVOGADRO_IO_MDLFORMAT_H |