Convert forcefield search to C++
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 11 Jan 2015 11:34:03 +0000 (13:34 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 20 Jan 2015 17:15:17 +0000 (18:15 +0100)
commitcd45ed34a236aecd92b1aa05950057f2ec27d33b
tree90c376c65fc873d58b347de6314c4e6565ca403d
parent9fdbb11cd4fbc53e25257dcc1526c85567afce9b
Convert forcefield search to C++

- Convert gmx_directory_*() to a C++ class in directoryenumerator.*
  (code moved from futil.* and converted to C++).
- Add some errno checks to detect error conditions better.
- Add a function to enumerate files/directories in all GMXLIB
  directories to DataFileFinder, and use this to replace functionality
  in fflibutil.cpp.
- Convert the code to enumerate forcefields into a C++ function with a
  more descriptive name, and convert the choose_ff() function to C++ to
  avoid complicated logic where the same directory is searched multiple
  times with different functions.

This is mainly a rewrite of the code in C++, with only minor functional
changes:
- Unit tests of this code no longer get confused by GMXLIB being set
  (currently, there are no such tests, though).
- Force fields are searched using the same logic as other data files
  (the default directory is always searched).
- Some I/O errors are now handled with more descriptive errors instead
  of silently ignoring directories that cannot be listed.

Change-Id: Ib3d070af5907ea00dfa9409e753868251eb8c7da
src/gromacs/gmxpreprocess/fflibutil.cpp
src/gromacs/gmxpreprocess/fflibutil.h
src/gromacs/gmxpreprocess/pdb2top.cpp
src/gromacs/utility/datafilefinder.cpp
src/gromacs/utility/datafilefinder.h
src/gromacs/utility/directoryenumerator.cpp [new file with mode: 0644]
src/gromacs/utility/directoryenumerator.h [new file with mode: 0644]
src/gromacs/utility/futil.cpp
src/gromacs/utility/futil.h