MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / ComposeNewPath

Method ComposeNewPath

external/ImGuiFileDialog/ImGuiFileDialog.cpp:2441–2470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2439}
2440
2441std::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
2472bool IGFD::FileManager::SetPathOnParentDirectoryIfAny() {
2473 if (m_CurrentPathDecomposition.size() > 1) {

Callers 1

m_DisplayPathPopupMethod · 0.80

Calls 4

backMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected