PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900

◆ 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().