| 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 |
#include "cmsgpackformat.h" |
| 7 |
|
| 8 |
#include <iostream> |
| 9 |
|
| 10 |
namespace Avogadro::Io { |
| 11 |
|
| 12 |
std::vector<std::string> CMsgPackFormat::fileExtensions() const |
| 13 |
{ |
| 14 |
std::vector<std::string> ext; |
| 15 |
ext.emplace_back("cmpk"); |
| 16 |
return ext; |
| 17 |
} |
| 18 |
|
| 19 |
std::vector<std::string> CMsgPackFormat::mimeTypes() const |
| 20 |
{ |
| 21 |
std::vector<std::string> mime; |
| 22 |
mime.emplace_back("chemical/x-cmpack"); |
| 23 |
return mime; |
| 24 |
} |
| 25 |
|
| 26 |
bool CMsgPackFormat::read(std::istream& in, Core::Molecule& molecule) |
| 27 |
{ |
| 28 |
return CjsonFormat::deserialize(in, molecule, false); |
| 29 |
} |
| 30 |
|
| 31 |
bool CMsgPackFormat::write(std::ostream& out, const Core::Molecule& molecule) |
| 32 |
{ |
| 33 |
return CjsonFormat::serialize(out, molecule, false); |
| 34 |
} |
| 35 |
|
| 36 |
} // namespace Avogadro::Io |