Substitute the placeholder in the file name with the current frame number. */
| 981 | /** Substitute the placeholder in the file name with the current frame number. |
| 982 | */ |
| 983 | std::string convertFileName(const std::string &inputFileName, const unsigned int currentFrame) |
| 984 | { |
| 985 | std::string fileName = inputFileName; |
| 986 | std::string::size_type pos1 = fileName.find_first_of("#", 0); |
| 987 | if (pos1 == std::string::npos) |
| 988 | { |
| 989 | LOG_ERR << "# missing in file name."; |
| 990 | exit(1); |
| 991 | } |
| 992 | std::string::size_type pos2 = fileName.find_first_not_of("#", pos1); |
| 993 | std::string::size_type length = pos2 - pos1; |
| 994 | |
| 995 | std::string numberStr = zeroPadding(currentFrame, (unsigned int)length); |
| 996 | fileName.replace(pos1, length, numberStr); |
| 997 | return fileName; |
| 998 | } |
| 999 | |
| 1000 | /** Read fluid particles of current frame. |
| 1001 | */ |
no test coverage detected