| 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_QUANTUMIO_GENERICJSON_H |
| 7 |
#define AVOGADRO_QUANTUMIO_GENERICJSON_H |
| 8 |
|
| 9 |
#include "avogadroquantumioexport.h" |
| 10 |
#include <avogadro/io/fileformat.h> |
| 11 |
|
| 12 |
#include <map> |
| 13 |
#include <vector> |
| 14 |
|
| 15 |
namespace Avogadro { |
| 16 |
namespace QuantumIO { |
| 17 |
|
| 18 |
class AVOGADROQUANTUMIO_EXPORT GenericJson : public Io::FileFormat |
| 19 |
{ |
| 20 |
public: |
| 21 |
GenericJson(); |
| 22 |
~GenericJson() override; |
| 23 |
|
| 24 |
Operations supportedOperations() const override |
| 25 |
{ |
| 26 |
return Read | File | Stream | String; |
| 27 |
// TODO add write operation |
| 28 |
} |
| 29 |
|
| 30 |
FileFormat* newInstance() const override { return new GenericJson; } |
| 31 |
std::string identifier() const override { return "Avogadro: Generic JSON"; } |
| 32 |
std::string name() const override { return "Generic JSON"; } |
| 33 |
std::string description() const override { return "Generic JSON format."; } |
| 34 |
|
| 35 |
std::string specificationUrl() const override { return ""; } |
| 36 |
|
| 37 |
std::vector<std::string> fileExtensions() const override; |
| 38 |
std::vector<std::string> mimeTypes() const override; |
| 39 |
|
| 40 |
[[nodiscard]] bool read(std::istream& in, Core::Molecule& molecule) override; |
| 41 |
[[nodiscard]] bool write(std::ostream&, const Core::Molecule&) override |
| 42 |
{ |
| 43 |
// Empty, as we do not currently write QC_SCHEMA files. |
| 44 |
return false; |
| 45 |
} |
| 46 |
}; |
| 47 |
|
| 48 |
} // namespace QuantumIO |
| 49 |
} // namespace Avogadro |
| 50 |
|
| 51 |
#endif |