OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
entity_io_sdf_handler.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_IO_ENTITY_IO_PLUGIN_SDF_H
20 #define OST_IO_ENTITY_IO_PLUGIN_SDF_H
21 
23 
24 namespace ost { namespace io {
25 
26 class DLLEXPORT_OST_IO EntityIOSDFHandler: public EntityIOHandler {
27 public:
28  virtual void Import(mol::EntityHandle& ent,
29  const boost::filesystem::path& loc);
30  virtual void Export(const mol::EntityView& ent,
31  const boost::filesystem::path& loc) const;
32  // import data from provided stream
33  virtual void Import(mol::EntityHandle& ent,
34  std::istream& stream);
35  // export data from entity view to provided stream
36  virtual void Export(const mol::EntityView& ent,
37  std::ostream& stream) const;
38  static bool ProvidesImport(const boost::filesystem::path& loc,
39  const String& format="auto");
40  static bool ProvidesExport(const boost::filesystem::path& loc,
41  const String& format="auto");
42 
43  virtual bool RequiresProcessor() const;
44 
45  static String GetFormatName() { return String("Sdf"); }
46  static String GetFormatDescription() { return String("Structure-data format from Molecular Design Limited"); }
47 };
48 
49 typedef EntityIOHandlerFactory<EntityIOSDFHandler> EntityIOSDFHandlerFactory;
50 
52 
53 }} // ns
54 
55 #endif
std::string String
Definition: base.hh:54
Protein or molecule.
mol::EntityHandle DLLEXPORT_OST_IO LoadSDF(const String &file_name)
#define DLLEXPORT_OST_IO
EntityIOHandlerFactory< EntityIOSDFHandler > EntityIOSDFHandlerFactory