Chemfiles internals =================== Sources organization -------------------- 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 development. - ``src``: the sources of the library; - ``tests``: the sources of the unit tests; Classes organization -------------------- Chemfiles is written in C++11, in an object-oriented fashion. A ``Trajectory`` is built on the top of two other private classes: a :ref:`File ` and a :ref:`Format `. These are pure abstract class defining the interface for reading and writing data. Adding new formats and tweaking behavior 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. .. toctree:: :maxdepth: 2 files/index format 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, by specializing the :cpp:func:`chemfiles::format_metadata` template and calling :cpp:func:`chemfiles::FormatFactory::add_format`. .. doxygenclass:: chemfiles::FormatFactory :members: .. doxygenfunction:: chemfiles::format_metadata