本文整理汇总了C++中Packer::WritePack方法的典型用法代码示例。如果您正苦于以下问题:C++ Packer::WritePack方法的具体用法?C++ Packer::WritePack怎么用?C++ Packer::WritePack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Packer
的用法示例。
在下文中一共展示了Packer::WritePack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
#endif
{
#ifdef WIN32
wstring exePath(argv[0]);
#else
string arg = string(argv[0]);
wstring exePath(arg.begin(), arg.end());
#endif
if(argc != 3) {
cout << "Usage: pack <directory> <outputPath>" << endl;
return -1;
}
#ifdef WIN32
wstring dirName(argv[1]);
#else
arg = string(argv[1]);
wstring dirName(arg.begin(), arg.end());
#endif
dirName = DirUtils::GetDirectoryName(dirName);
Packer* packer = new Packer();
packer->AddDirectory(dirName);
#ifdef WIN32
wstring outPath(argv[2]);
#else
arg = string(argv[2]);
wstring outPath(arg.begin(), arg.end());
#endif
cout << "Writing package... " << string(outPath.begin(), outPath.end()) << endl;
packer->WritePack(outPath);
delete packer;
//packer = Packer::ReadPack(L"C:\\TEST.PAK");
//PackEntry *entry = packer->GetEntry(L"Debug/PruebaTexto.txt");
//wchar_t* data = (wchar_t*) packer->GetUncompressedData(entry);
//wcout.imbue(locale(""));
//wstring test(data, 1, (entry->GetUncompressedSize() / sizeof(wchar_t)) - 1);
//wcout << test << endl;
//delete data;
//delete packer;
return 0;
}