| 2377 | } |
| 2378 | |
| 2379 | std::string IGFD::FileManager::ComposeNewPath(std::vector<std::string>::iterator vIter) { |
| 2380 | std::string res; |
| 2381 | |
| 2382 | while (true) { |
| 2383 | if (!res.empty()) { |
| 2384 | #ifdef _IGFD_WIN_ |
| 2385 | res = *vIter + IGFD::Utils::GetPathSeparator() + res; |
| 2386 | #elif defined(_IGFD_UNIX_) // _IGFD_UNIX_ is _IGFD_WIN_ or APPLE |
| 2387 | if (*vIter == fsRoot) |
| 2388 | res = *vIter + res; |
| 2389 | else |
| 2390 | res = *vIter + PATH_SEP + res; |
| 2391 | #endif // _IGFD_WIN_ |
| 2392 | } else |
| 2393 | res = *vIter; |
| 2394 | |
| 2395 | if (vIter == m_CurrentPathDecomposition.begin()) { |
| 2396 | #ifdef _IGFD_UNIX_ // _IGFD_UNIX_ is _IGFD_WIN_ or APPLE |
| 2397 | if (res[0] != PATH_SEP) res = PATH_SEP + res; |
| 2398 | #else |
| 2399 | if (res.back() != PATH_SEP) res.push_back(PATH_SEP); |
| 2400 | #endif // defined(_IGFD_UNIX_) |
| 2401 | break; |
| 2402 | } |
| 2403 | |
| 2404 | --vIter; |
| 2405 | } |
| 2406 | |
| 2407 | return res; |
| 2408 | } |
| 2409 | |
| 2410 | bool IGFD::FileManager::SetPathOnParentDirectoryIfAny() { |
| 2411 | if (m_CurrentPathDecomposition.size() > 1) { |
no test coverage detected