diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2011-04-11 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:05 +0300 |
commit | 35596517f203f1c4970413b3b5b2e216b849e462 (patch) | |
tree | 93240df3eb4ddbd8eebbe6a5fc65e93f2ccb6495 /CPP/7zip/UI/FileManager/PanelCrc.cpp | |
parent | de4f8c22fe4b9e59b60495b84db2e81de50999a9 (diff) |
9.219.21
Diffstat (limited to 'CPP/7zip/UI/FileManager/PanelCrc.cpp')
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelCrc.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/CPP/7zip/UI/FileManager/PanelCrc.cpp b/CPP/7zip/UI/FileManager/PanelCrc.cpp index 6b00a9b5..2dd5e7ce 100755 --- a/CPP/7zip/UI/FileManager/PanelCrc.cpp +++ b/CPP/7zip/UI/FileManager/PanelCrc.cpp @@ -29,13 +29,13 @@ static const UInt32 kBufSize = (1 << 15); struct CDirEnumerator { bool FlatMode; - UString BasePrefix; - UStringVector FileNames; + FString BasePrefix; + FStringVector FileNames; - CObjectVector<NFind::CEnumeratorW> Enumerators; - UStringVector Prefixes; + CObjectVector<NFind::CEnumerator> Enumerators; + FStringVector Prefixes; int Index; - HRESULT GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UString &fullPath); + HRESULT GetNextFile(NFind::CFileInfo &fileInfo, bool &filled, FString &fullPath); void Init(); CDirEnumerator(): FlatMode(false) {}; @@ -54,7 +54,7 @@ static HRESULT GetNormalizedError() return (errorCode == 0) ? E_FAIL : errorCode; } -HRESULT CDirEnumerator::GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UString &resPath) +HRESULT CDirEnumerator::GetNextFile(NFind::CFileInfo &fileInfo, bool &filled, FString &resPath) { filled = false; for (;;) @@ -63,8 +63,8 @@ HRESULT CDirEnumerator::GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, U { if (Index >= FileNames.Size()) return S_OK; - const UString &path = FileNames[Index]; - int pos = path.ReverseFind(WCHAR_PATH_SEPARATOR); + const FString &path = FileNames[Index]; + int pos = path.ReverseFind(FCHAR_PATH_SEPARATOR); resPath.Empty(); if (pos >= 0) resPath = path.Left(pos + 1); @@ -106,8 +106,8 @@ HRESULT CDirEnumerator::GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, U resPath += fileInfo.Name; if (!FlatMode && fileInfo.IsDir()) { - UString prefix = resPath + WCHAR_PATH_SEPARATOR; - Enumerators.Add(NFind::CEnumeratorW(BasePrefix + prefix + (UString)(wchar_t)NName::kAnyStringWildcard)); + FString prefix = resPath + FCHAR_PATH_SEPARATOR; + Enumerators.Add(NFind::CEnumerator(BasePrefix + prefix + FCHAR_ANY_MASK)); Prefixes.Add(prefix); } filled = true; @@ -212,13 +212,13 @@ HRESULT CThreadCrc::ProcessVirt() for (;;) { - NFind::CFileInfoW fileInfo; + NFind::CFileInfo fileInfo; bool filled; - UString resPath; + FString resPath; HRESULT errorCode = Enumerator.GetNextFile(fileInfo, filled, resPath); if (errorCode != 0) { - ErrorPath1 = resPath; + SetErrorPath1(resPath); return errorCode; } if (!filled) @@ -228,7 +228,7 @@ HRESULT CThreadCrc::ProcessVirt() totalSize += fileInfo.Size; NumFilesScan++; } - sync.SetCurrentFileName(scanningStr + resPath); + sync.SetCurrentFileName(scanningStr + fs2us(resPath)); sync.SetProgress(totalSize, 0); RINOK(sync.SetPosAndCheckPaused(0)); } @@ -239,13 +239,13 @@ HRESULT CThreadCrc::ProcessVirt() for (;;) { - NFind::CFileInfoW fileInfo; + NFind::CFileInfo fileInfo; bool filled; - UString resPath; + FString resPath; HRESULT errorCode = Enumerator.GetNextFile(fileInfo, filled, resPath); if (errorCode != 0) { - ErrorPath1 = resPath; + SetErrorPath1(resPath); return errorCode; } if (!filled) @@ -263,10 +263,10 @@ HRESULT CThreadCrc::ProcessVirt() if (!inFile.Open(Enumerator.BasePrefix + resPath)) { errorCode = GetNormalizedError(); - ErrorPath1 = resPath; + SetErrorPath1(resPath); return errorCode; } - sync.SetCurrentFileName(resPath); + sync.SetCurrentFileName(fs2us(resPath)); sync.SetNumFilesCur(NumFiles); NumFiles++; for (;;) @@ -275,7 +275,7 @@ HRESULT CThreadCrc::ProcessVirt() if (!inFile.Read(buffer, kBufSize, processedSize)) { errorCode = GetNormalizedError(); - ErrorPath1 = resPath; + SetErrorPath1(resPath); return errorCode; } if (processedSize == 0) @@ -323,8 +323,8 @@ void CApp::CalculateCrc() { CThreadCrc t; for (int i = 0; i < indices.Size(); i++) - t.Enumerator.FileNames.Add(srcPanel.GetItemRelPath(indices[i])); - t.Enumerator.BasePrefix = srcPanel.GetFsPath(); + t.Enumerator.FileNames.Add(us2fs(srcPanel.GetItemRelPath(indices[i]))); + t.Enumerator.BasePrefix = us2fs(srcPanel.GetFsPath()); t.Enumerator.FlatMode = GetFlatMode(); t.ProgressDialog.ShowCompressionInfo = false; |