114 if (m_bExtractLzmaUsing7Zip &&
115 std::find(LZMA_FILE_EXTENSIONS.begin(), LZMA_FILE_EXTENSIONS.end(), m_path.extension()) != LZMA_FILE_EXTENSIONS.end())
117 if (m_bExtractLzmaInProc)
119 return ExtractLzmaInProc(destinationPath);
123 return ExtractLzmaOutOfProc(destinationPath);
134 std::error_code canonicalError;
135 auto canonicalDestination = weakly_canonical(path(destinationPath), canonicalError);
138 canonicalDestination = path(destinationPath);
141 if (
extract(m_path.string().c_str(), canonicalDestination.string().c_str()))
143 m_extractionDirectory = canonicalDestination.string();
153 path uncompressedPath;
163 if (!filename.empty())
165 logwarn(
"getUncompressedFilePath refused unsafe member name: [" + filename +
"]");
167 return uncompressedPath;
170 path possibleUncompressedFilePath = directory / filename;
171 auto uncompressedFileExists = exists(possibleUncompressedFilePath) && is_regular_file(possibleUncompressedFilePath);
172 if (uncompressedFileExists)
174 uncompressedPath = possibleUncompressedFilePath;
178 path possibleCompressedFilePath = directory / filename;
179 possibleCompressedFilePath.replace_extension(
"Z");
181 auto compressedFileExists =
false;
182 if (exists(possibleCompressedFilePath) && is_regular_file(possibleCompressedFilePath))
184 compressedFileExists =
true;
188 possibleCompressedFilePath.replace_extension(
"z");
189 if (exists(possibleCompressedFilePath) && is_regular_file(possibleCompressedFilePath))
191 compressedFileExists =
true;
195 if (compressedFileExists)
202 uncompressedPath /= filename;
207 return uncompressedPath;