michael@0: // DefaultName.cpp michael@0: michael@0: #include "StdAfx.h" michael@0: michael@0: #include "DefaultName.h" michael@0: michael@0: static const wchar_t *kEmptyFileAlias = L"[Content]"; michael@0: michael@0: UString GetDefaultName2(const UString &fileName, michael@0: const UString &extension, const UString &addSubExtension) michael@0: { michael@0: int extLength = extension.Length(); michael@0: int fileNameLength = fileName.Length(); michael@0: if (fileNameLength > extLength + 1) michael@0: { michael@0: int dotPos = fileNameLength - (extLength + 1); michael@0: if (fileName[dotPos] == '.') michael@0: if (extension.CompareNoCase(fileName.Mid(dotPos + 1)) == 0) michael@0: return fileName.Left(dotPos) + addSubExtension; michael@0: } michael@0: return kEmptyFileAlias; michael@0: } michael@0: