MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / MakeFileName

Method MakeFileName

rtpose_wrapper/src/gtest/gtest-all.cpp:7603–7614  ·  view source on GitHub ↗

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 /.

Source from the content-addressed store, hash-verified

7601// than zero (e.g., 12), returns "dir/test_12.xml".
7602// On Windows platform, uses \ as the separator rather than /.
7603FilePath 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 /.

Callers

nothing calls this directly

Calls 2

FormatClass · 0.85
FilePathFunction · 0.85

Tested by

no test coverage detected