MCPcopy Create free account
hub / github.com/bluescan/tacentview / DirToPath

Method DirToPath

Src/FileDialog.cpp:1925–1949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1923
1924
1925void FileDialog::DirToPath(tList<tStringItem>& destPath, const tString& srcdir)
1926{
1927 destPath.Empty();
1928 if (srcdir.IsEmpty())
1929 return;
1930
1931 // Smallest path would be "/"
1932 tString dir(srcdir);
1933 bool isNetwork = false;
1934 if ((dir.Length() >= 2) && (dir[0] == '\\') && (dir[1] == '\\'))
1935 isNetwork = true;
1936
1937 if (isNetwork)
1938 destPath.Append(new tStringItem("Network"));
1939 else
1940 destPath.Append(new tStringItem("Root"));
1941
1942 dir.Replace("\\\\", "/");
1943 dir.Replace("\\", "/");
1944
1945 if (dir[0] == '/')
1946 dir.ExtractLeft('/');
1947
1948 tExplode(destPath, dir, '/');
1949}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected