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 /.
| 7601 | // than zero (e.g., 12), returns "dir/test_12.xml". |
| 7602 | // On Windows platform, uses \ as the separator rather than /. |
| 7603 | FilePath FilePath::MakeFileName(const FilePath& directory, |
| 7604 | const FilePath& base_name, |
| 7605 | int number, |
| 7606 | const char* extension) { |
| 7607 | String file; |
| 7608 | if (number == 0) { |
| 7609 | file = String::Format("%s.%s", base_name.c_str(), extension); |
| 7610 | } else { |
| 7611 | file = String::Format("%s_%d.%s", base_name.c_str(), number, extension); |
| 7612 | } |
| 7613 | return ConcatPaths(directory, FilePath(file)); |
| 7614 | } |
| 7615 | |
| 7616 | // Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml". |
| 7617 | // On Windows, uses \ as the separator rather than /. |