Debian Codegraph @

avogadro/io/xyzformat.h

raw
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_XYZFORMAT_H
7 #define AVOGADRO_IO_XYZFORMAT_H
8
9 #include "fileformat.h"
10
11 namespace Avogadro::Io {
12
13 /**
14 * @class XyzFormat xyzformat.h <avogadro/io/xyzformat.h>
15 * @brief Implementation of the generic xyz format.
16 * @author Allison Vacanti
17 */
18
19 class AVOGADROIO_EXPORT XyzFormat : public FileFormat
20 {
21 public:
22 XyzFormat() = default;
23 ~XyzFormat() override = default;
24
25 Operations supportedOperations() const override
26 {
27 return ReadWrite | MultiMolecule | File | Stream | String;
28 }
29
30 FileFormat* newInstance() const override { return new XyzFormat; }
31 std::string identifier() const override { return "Avogadro: XYZ"; }
32 std::string name() const override { return "XYZ"; }
33 std::string description() const override
34 {
35 return "Generic format that tabulates atomic symbols and 3D positions.";
36 }
37
38 std::string specificationUrl() const override
39 {
40 return "https://en.wikipedia.org/wiki/XYZ_file_format";
41 // "http://openbabel.org/wiki/XYZ";
42 }
43
44 std::vector<std::string> fileExtensions() const override;
45 std::vector<std::string> mimeTypes() const override;
46
47 [[nodiscard]] bool read(std::istream& inStream,
48 Core::Molecule& molecule) override;
49 [[nodiscard]] bool write(std::ostream& outStream,
50 const Core::Molecule& molecule) override;
51 };
52
53 } // namespace Avogadro::Io
54
55 #endif // AVOGADRO_IO_XYZFORMAT_H