new convencience function for checking valid IDs (includes unit tests)

This commit is contained in:
Axel Kohlmeyer
2021-03-02 11:01:51 -05:00
parent 0f63f07ce5
commit ca8b268ad5
3 changed files with 81 additions and 2 deletions

View File

@ -335,6 +335,14 @@ namespace LAMMPS_NS {
bool is_double(const std::string &str);
/** Check if string is a valid ID
* ID strings may contain only letters, numbers, and underscores.
*
* \param str string that should be checked
* \return true, if string contains valid id, false otherwise */
bool is_id(const std::string &str);
/** Try to detect pathname from FILE pointer.
*
* Currently only supported on Linux, otherwise will report "(unknown)".