You will find the following directory in chemfiles source code:
cmake
: CMake modules used for build configuration;doc
: the source for this documentation;examples
: usage examples for C and C++ interfaces;external
: external libraries used by chemfiles;include
: the headers of chemfiles;scripts
: some python and bash scripts used in developpement.src
: the sources of the library;tests
: the sources of the unit tests;Chemfiles is written in C++11, in an object-oriented fashion. A Trajectory
is built on the top of two other private classes: a File and
a Format. These are pure abstract class defining the
interface for reading and writing data.
Adding new formats and tweaking behaviour of existing formats should be done
either in the File
implementation for everything related to interactions
with the actual file, or in the Format
implementation for everything related
with parsing data from the file.
Every Format
class can be associated to an extension and a format name, the
associations are managed by the FormatFactory
class. New file and formats
should be registered with this class.
chemfiles::
FormatFactory
¶This class allow to register Format with names and file extensions.
Public Functions
format
(const std::string &name)¶Get a `format_creator_t` from a format type name.
Throws an error if the format can not be found
name
: the format name by_extension
(const std::string &ext)¶Get a `format_creator_t` from a format extention.
Throws an error if the format can not be found
ext
: the format extention register_format
(const std::string &name, format_creator_t creator)¶Register a `format_creator_t` in the internal format names list.
register_extension
(const std::string &ext, format_creator_t creator)¶Register a `format_creator_t` in the internal extensions list.
Public Static Functions
get
()¶Get the instance of the TrajectoryFactory.