MCPcopy Create free account
hub / github.com/WinMerge/winmerge / ApplyDisplayRoot

Method ApplyDisplayRoot

Src/DirDoc.cpp:814–832  ·  view source on GitHub ↗

* @brief Replace internal root by display root * When we have a archive file open, this function converts physical folder * (that is in the temp folder where archive was extracted) to the virtual * path for showing. The virtual path is path to the archive file, archive * file name and folder inside the archive. * @param [in, out] sText Path to convert. */

Source from the content-addressed store, hash-verified

812 * @param [in, out] sText Path to convert.
813 */
814void CDirDoc::ApplyDisplayRoot(int nIndex, String &sText)
815{
816 if (m_pTempPathContext != nullptr)
817 {
818 if (sText.find(m_pTempPathContext->m_strRoot[nIndex]) == String::npos)
819 {
820 for (int pane = 0; pane < m_nDirs; ++pane)
821 {
822 if (sText.find(m_pTempPathContext->m_strRoot[pane]) != String::npos)
823 {
824 nIndex = pane;
825 break;
826 }
827 }
828 }
829 sText.erase(0, m_pTempPathContext->m_strRoot[nIndex].length());
830 sText.insert(0, m_pTempPathContext->m_strDisplayRoot[nIndex]);
831 }
832}
833
834/**
835 * @brief Set document title to given string or items compared.

Callers 6

UpdateHeaderPathMethod · 0.80
GenerateReportMethod · 0.80
UpdateHeaderPathMethod · 0.80
OnToolsGenerateReportMethod · 0.80
UpdateHeaderPathMethod · 0.80
UpdateHeaderPathMethod · 0.80

Calls 4

findMethod · 0.45
eraseMethod · 0.45
lengthMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected