MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / MakeFileName

Method MakeFileName

tests/gtest/gtest-all.cc:9416–9428  ·  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

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

Callers

nothing calls this directly

Calls 2

StreamableToStringFunction · 0.85
FilePathFunction · 0.85

Tested by

no test coverage detected