MCPcopy Create free account
hub / github.com/CppMicroServices/CppMicroServices / MakeUniqueTempFile

Function MakeUniqueTempFile

framework/test/util/TestUtils.cpp:469–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467 }
468
469 File
470 MakeUniqueTempFile(std::string const& base)
471 {
472 auto const tmpStr = base + util::DIR_SEP + "usfile-XXXXXX";
473 std::vector<char> tmpChars(tmpStr.c_str(), tmpStr.c_str() + tmpStr.length() + 1);
474
475 errno = 0;
476 int fd = mkstemps_compat(tmpChars.data(), 0);
477 if (fd < 0)
478 throw std::runtime_error(util::GetLastCErrorStr());
479
480 return File(fd, tmpChars.data());
481 }
482
483 Bundle
484 GetBundle(std::string const& bsn, BundleContext context)

Callers 2

TESTFunction · 0.85
TEST_FFunction · 0.85

Calls 3

mkstemps_compatFunction · 0.85
GetLastCErrorStrFunction · 0.85
FileClass · 0.85

Tested by

no test coverage detected