本文整理汇总了C++中Packer::addFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Packer::addFile方法的具体用法?C++ Packer::addFile怎么用?C++ Packer::addFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packer
的用法示例。
在下文中一共展示了Packer::addFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char ** argv)
{
std::cout << "--------------------------------------------" << std::endl
<< "Pakunpaker v1.0 by Xesc & Technology 2008-09" << std::endl
<< "--------------------------------------------" << std::endl << std::endl;
if (argc > 2)
{
// create a new package
if (strcmp(argv[1], "-i") == 0)
{
Packer *packer = new Packer;
for (int param = 3; param < argc; param++)
{
packer->addFile(std::string(argv[param]));
std::cout << "added: " << argv[param] << std::endl;
}
packer->buildPackage(argv[2]);
std::cout << "Package build: " << argv[2] << std::endl;
delete packer;
}
// extract files from package
else if ((strcmp(argv[1], "-o") == 0 || strcmp(argv[1], "-oo") == 0) && argc == 4)
{
Unpacker *unpacker = new Unpacker;
unpacker->extractPackage(std::string(argv[2]), std::string(argv[3]), strcmp(argv[1], "-o") == 0);
for (int n = 0; n < unpacker->getExtractedFilesCount(); n++)
std::cout << "Unpacked file " << n + 1 << " to: " << unpacker->getExtractedFileName(n) << std::endl;
delete unpacker;
}
else // unknonw parameters
displayHelp();
}
else // invalid parameters
displayHelp();
return 0;
}