Files
dnf-utils/sgutil/sgu_mode_npk_dump_list.h
T
2025-09-01 20:47:58 +08:00

19 lines
887 B
C

#pragma once
/**
* Dumps the file list from an NPK archive to a text file.
*
* @param inputFilename The path to the NPK archive file to be read.
* @param outputFilename The path to the output text file where the file list will be written.
* @return true if the operation succeeds; false otherwise.
*
* The function performs the following steps:
* 1. Validates the input and output file names.
* 2. Opens the NPK archive and retrieves the number of contained files.
* 3. Iterates through each file entry in the archive, extracting its name, offset, and size.
* 4. Writes the file list to the output text file in tab-separated format: fileName, fileOffset, fileSize.
* 5. Closes all files and releases resources.
* 6. Returns true on success, or false if any error occurs during processing.
*/
bool dumpNPKFileList(const char* szNPKFileName, const char* szListFileName);