PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800

◆ filename_add_suffix()

std::string pism::filename_add_suffix ( const std::string &  filename,
const std::string &  separator,
const std::string &  suffix 
)

Adds a suffix to a filename.

Returns filename + separator + suffix + .nc if the original filename had the .nc suffix, otherwise filename + separator. If the old filename had the form "name + separator + more stuff + .nc", then removes the string after the separator.

Definition at line 364 of file pism_utilities.cc.

References ends_with().

Referenced by pism::Geometry::ensure_consistency(), pism::IceModel::init_checkpoints(), and pism::IceModel::save_state_on_error().