Debian Codegraph @

avogadro/io/cmlformat.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_CMLFORMAT_H
7 #define AVOGADRO_IO_CMLFORMAT_H
8
9 #include "fileformat.h"
10
11 namespace Avogadro::Io {
12
13 /**
14 * @class CmlFormat cmlformat.h <avogadro/io/cmlformat.h>
15 * @brief Implementation of the Chemical Markup Language format.
16 * @author Marcus D. Hanwell
17 */
18
19 class AVOGADROIO_EXPORT CmlFormat : public FileFormat
20 {
21 public:
22 CmlFormat() = default;
23 ~CmlFormat() override = default;
24
25 Operations supportedOperations() const override
26 {
27 return ReadWrite | File | Stream | String;
28 }
29
30 FileFormat* newInstance() const override { return new CmlFormat; }
31 std::string identifier() const override { return "Avogadro: CML"; }
32 std::string name() const override { return "Chemical Markup Language"; }
33 std::string description() const override
34 {
35 return "TODO: Describe the format.";
36 }
37
38 std::string specificationUrl() const override
39 {
40 return "http://www.xml-cml.org/schema/schema3/";
41 }
42
43 std::vector<std::string> fileExtensions() const override;
44 std::vector<std::string> mimeTypes() const override;
45
46 [[nodiscard]] bool read(std::istream& in, Core::Molecule& molecule) override;
47 [[nodiscard]] bool write(std::ostream& out,
48 const Core::Molecule& molecule) override;
49 };
50
51 } // namespace Avogadro::Io
52
53 #endif // CMLFORMAT_H