diff options
Diffstat (limited to 'CPP/7zip/UI/Common/ArchiveName.cpp')
-rwxr-xr-x | CPP/7zip/UI/Common/ArchiveName.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/CPP/7zip/UI/Common/ArchiveName.cpp b/CPP/7zip/UI/Common/ArchiveName.cpp index c3684def..17947dce 100755 --- a/CPP/7zip/UI/Common/ArchiveName.cpp +++ b/CPP/7zip/UI/Common/ArchiveName.cpp @@ -9,19 +9,19 @@ using namespace NWindows; -static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool keepName) +static FString CreateArchiveName2(const FString &srcName, bool fromPrev, bool keepName) { - UString resultName = L"Archive"; + FString resultName = FTEXT("Archive"); if (fromPrev) { - UString dirPrefix; + FString dirPrefix; if (NFile::NDirectory::GetOnlyDirPrefix(srcName, dirPrefix)) { if (dirPrefix.Length() > 0) - if (dirPrefix[dirPrefix.Length() - 1] == WCHAR_PATH_SEPARATOR) + if (dirPrefix.Back() == FCHAR_PATH_SEPARATOR) { - dirPrefix.Delete(dirPrefix.Length() - 1); - NFile::NFind::CFileInfoW fileInfo; + dirPrefix.DeleteBack(); + NFile::NFind::CFileInfo fileInfo; if (fileInfo.Find(dirPrefix)) resultName = fileInfo.Name; } @@ -29,7 +29,7 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke } else { - NFile::NFind::CFileInfoW fileInfo; + NFile::NFind::CFileInfo fileInfo; if (!fileInfo.Find(srcName)) // return resultName; return srcName; @@ -39,8 +39,8 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke int dotPos = resultName.ReverseFind('.'); if (dotPos > 0) { - UString archiveName2 = resultName.Left(dotPos); - if (archiveName2.ReverseFind('.') < 0) + FString archiveName2 = resultName.Left(dotPos); + if (archiveName2.ReverseFind(FTEXT('.')) < 0) resultName = archiveName2; } } @@ -50,5 +50,5 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke UString CreateArchiveName(const UString &srcName, bool fromPrev, bool keepName) { - return GetCorrectFsPath(CreateArchiveName2(srcName, fromPrev, keepName)); + return GetCorrectFsPath(fs2us(CreateArchiveName2(us2fs(srcName), fromPrev, keepName))); } |