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

Method GetWorkingDirectoryOnDrive

Source/cmPathResolver.cxx:168–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166
167#ifdef _WIN32
168std::string ImplBase::GetWorkingDirectoryOnDrive(char letter)
169{
170 // Use the drive's working directory, if any.
171 std::string d = this->OS.GetWorkingDirectoryOnDrive(letter);
172 std::replace(d.begin(), d.end(), '\\', '/');
173 if (d.size() >= 3 &&
174 cmsysString_toupper(d[0]) == cmsysString_toupper(letter) &&
175 d[1] == ':' && d[2] == '/') {
176 d[0] = letter;
177 d.push_back('/');
178 return d;
179 }
180
181 // Use the current working directory if the drive matches.
182 d = this->OS.GetWorkingDirectory();
183 if (d.size() >= 3 &&
184 cmsysString_toupper(d[0]) == cmsysString_toupper(letter) &&
185 d[1] == ':' && d[2] == '/') {
186 d[0] = letter;
187 d.push_back('/');
188 return d;
189 }
190
191 // Fall back to the root directory on the drive.
192 d = "_:/";
193 d[0] = letter;
194 return d;
195}
196
197Control ImplBase::ResolveRootRelative()
198{

Callers 1

ResolveRootRelativeMethod · 0.95

Calls 5

push_backMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
GetWorkingDirectoryMethod · 0.45

Tested by

no test coverage detected