| 2439 | } |
| 2440 | |
| 2441 | std::string IGFD::FileManager::ComposeNewPath(std::vector<std::string>::iterator vIter) { |
| 2442 | std::string res; |
| 2443 | |
| 2444 | while (true) { |
| 2445 | if (!res.empty()) { |
| 2446 | #ifdef _IGFD_WIN_ |
| 2447 | res = *vIter + IGFD::Utils::GetPathSeparator() + res; |
| 2448 | #elif defined(_IGFD_UNIX_) // _IGFD_UNIX_ is _IGFD_WIN_ or APPLE |
| 2449 | if (*vIter == fsRoot) |
| 2450 | res = *vIter + res; |
| 2451 | else |
| 2452 | res = *vIter + PATH_SEP + res; |
| 2453 | #endif // _IGFD_WIN_ |
| 2454 | } else |
| 2455 | res = *vIter; |
| 2456 | |
| 2457 | if (vIter == m_CurrentPathDecomposition.begin()) { |
| 2458 | #ifdef _IGFD_UNIX_ // _IGFD_UNIX_ is _IGFD_WIN_ or APPLE |
| 2459 | if (res[0] != PATH_SEP) res = PATH_SEP + res; |
| 2460 | #else |
| 2461 | if (res.back() != PATH_SEP) res.push_back(PATH_SEP); |
| 2462 | #endif // defined(_IGFD_UNIX_) |
| 2463 | break; |
| 2464 | } |
| 2465 | |
| 2466 | --vIter; |
| 2467 | } |
| 2468 | |
| 2469 | return res; |
| 2470 | } |
| 2471 | |
| 2472 | bool IGFD::FileManager::SetPathOnParentDirectoryIfAny() { |
| 2473 | if (m_CurrentPathDecomposition.size() > 1) { |
no test coverage detected