MCPcopy Create free account
hub / github.com/Kitware/CMake / Getcwd

Function Getcwd

Source/kwsys/SystemTools.cxx:314–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312 KWSYS_NAMESPACE::Encoding::ToWindowsExtendedPath(dir).c_str());
313}
314inline char const* Getcwd(char* buf, unsigned int len)
315{
316 std::vector<wchar_t> w_buf(len);
317 if (_wgetcwd(&w_buf[0], len)) {
318 size_t nlen = kwsysEncoding_wcstombs(buf, &w_buf[0], len);
319 if (nlen == static_cast<size_t>(-1)) {
320 return 0;
321 }
322 if (nlen < len) {
323 // make sure the drive letter is capital
324 if (nlen > 1 && buf[1] == ':') {
325 buf[0] = kwsysString_toupper(buf[0]);
326 }
327 return buf;
328 }
329 }
330 return 0;
331}
332inline int Chdir(std::string const& dir)
333{
334 // We cannot use ToWindowsExtendedPath here because that causes a

Callers 1

Calls 2

kwsysEncoding_wcstombsFunction · 0.85
kwsysString_toupperFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…