Given directory = "dir", base_name = "test", number = 0, extension = "xml", returns "dir/test.xml". If number is greater than zero (e.g., 12), returns "dir/test_12.xml". On Windows platform, uses \ as the separator rather than /.
| 9414 | // than zero (e.g., 12), returns "dir/test_12.xml". |
| 9415 | // On Windows platform, uses \ as the separator rather than /. |
| 9416 | FilePath FilePath::MakeFileName(const FilePath& directory, |
| 9417 | const FilePath& base_name, |
| 9418 | int number, |
| 9419 | const char* extension) { |
| 9420 | std::string file; |
| 9421 | if (number == 0) { |
| 9422 | file = base_name.string() + "." + extension; |
| 9423 | } else { |
| 9424 | file = base_name.string() + "_" + StreamableToString(number) |
| 9425 | + "." + extension; |
| 9426 | } |
| 9427 | return ConcatPaths(directory, FilePath(file)); |
| 9428 | } |
| 9429 | |
| 9430 | // Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml". |
| 9431 | // On Windows, uses \ as the separator rather than /. |
nothing calls this directly
no test coverage detected