VpkLib: rename CPackedStore to CPackedStoreBuilder

Avoid confusion with the game's CPackedStore class.
This commit is contained in:
Kawe Mazidjatari 2024-01-12 11:02:54 +01:00
parent 106670d940
commit a92847fa7a
4 changed files with 18 additions and 18 deletions

View File

@ -648,10 +648,10 @@ void VPK_Pack_f(const CCommand& args)
Msg(eDLL_T::FS, "*** Starting VPK build command for: '%s'\n", pair.m_DirName.Get()); Msg(eDLL_T::FS, "*** Starting VPK build command for: '%s'\n", pair.m_DirName.Get());
timer.Start(); timer.Start();
CPackedStore packedStore; CPackedStoreBuilder builder;
packedStore.InitLzCompParams(fs_packedstore_compression_level->GetString(), fs_packedstore_max_helper_threads->GetInt()); builder.InitLzCompParams(fs_packedstore_compression_level->GetString(), fs_packedstore_max_helper_threads->GetInt());
packedStore.PackWorkspace(pair, fs_packedstore_workspace->GetString(), "vpk/"); builder.PackWorkspace(pair, fs_packedstore_workspace->GetString(), "vpk/");
timer.End(); timer.End();
Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds()); Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds());
@ -680,10 +680,10 @@ void VPK_Unpack_f(const CCommand& args)
Msg(eDLL_T::FS, "*** Starting VPK extraction command for: '%s'\n", arg.Get()); Msg(eDLL_T::FS, "*** Starting VPK extraction command for: '%s'\n", arg.Get());
timer.Start(); timer.Start();
CPackedStore packedStore; CPackedStoreBuilder builder;
packedStore.InitLzDecompParams(); builder.InitLzDecompParams();
packedStore.UnpackWorkspace(vpk, fs_packedstore_workspace->GetString()); builder.UnpackWorkspace(vpk, fs_packedstore_workspace->GetString());
timer.End(); timer.End();
Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds()); Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds());

View File

@ -85,10 +85,10 @@ static void ReVPK_Pack(const CCommand& args)
Msg(eDLL_T::FS, "*** Starting VPK build command for: '%s'\n", pair.m_DirName.Get()); Msg(eDLL_T::FS, "*** Starting VPK build command for: '%s'\n", pair.m_DirName.Get());
timer.Start(); timer.Start();
CPackedStore packedStore; CPackedStoreBuilder builder;
packedStore.InitLzCompParams(); builder.InitLzCompParams();
packedStore.PackWorkspace(pair, "ship/", "vpk/"); builder.PackWorkspace(pair, "ship/", "vpk/");
timer.End(); timer.End();
Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds()); Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds());
@ -114,10 +114,10 @@ static void ReVPK_Unpack(const CCommand& args)
Msg(eDLL_T::FS, "*** Starting VPK extraction command for: '%s'\n", arg.Get()); Msg(eDLL_T::FS, "*** Starting VPK extraction command for: '%s'\n", arg.Get());
timer.Start(); timer.Start();
CPackedStore packedStore; CPackedStoreBuilder builder;
packedStore.InitLzDecompParams(); builder.InitLzDecompParams();
packedStore.UnpackWorkspace(vpk, "ship/"); builder.UnpackWorkspace(vpk, "ship/");
timer.End(); timer.End();
Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds()); Msg(eDLL_T::FS, "*** Time elapsed: '%lf' seconds\n", timer.GetDuration().GetSeconds());

View File

@ -61,7 +61,7 @@ static lzham_compress_level DetermineCompressionLevel(const char* compressionLev
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: initialize parameters for compression algorithm // Purpose: initialize parameters for compression algorithm
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CPackedStore::InitLzCompParams(const char* compressionLevel, const lzham_int32 maxHelperThreads) void CPackedStoreBuilder::InitLzCompParams(const char* compressionLevel, const lzham_int32 maxHelperThreads)
{ {
/*| PARAMETERS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ /*| PARAMETERS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
m_lzCompParams.m_struct_size = sizeof(lzham_compress_params); m_lzCompParams.m_struct_size = sizeof(lzham_compress_params);
@ -78,7 +78,7 @@ void CPackedStore::InitLzCompParams(const char* compressionLevel, const lzham_in
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: initialize parameters for decompression algorithm // Purpose: initialize parameters for decompression algorithm
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CPackedStore::InitLzDecompParams(void) void CPackedStoreBuilder::InitLzDecompParams(void)
{ {
/*| PARAMETERS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ /*| PARAMETERS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||*/
m_lzDecompParams.m_struct_size = sizeof(lzham_decompress_params); m_lzDecompParams.m_struct_size = sizeof(lzham_decompress_params);
@ -412,7 +412,7 @@ static void ValidateCRC32PostDecomp(const CUtlString& assetPath, const uint32_t
// chunkIndex - // chunkIndex -
// Output : true if the chunk was deduplicated, false otherwise // Output : true if the chunk was deduplicated, false otherwise
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool CPackedStore::Deduplicate(const uint8_t* pEntryBuffer, VPKChunkDescriptor_t& descriptor, const size_t chunkIndex) bool CPackedStoreBuilder::Deduplicate(const uint8_t* pEntryBuffer, VPKChunkDescriptor_t& descriptor, const size_t chunkIndex)
{ {
string entryHash(reinterpret_cast<const char*>(pEntryBuffer), descriptor.m_nUncompressedSize); string entryHash(reinterpret_cast<const char*>(pEntryBuffer), descriptor.m_nUncompressedSize);
entryHash = sha1(entryHash); entryHash = sha1(entryHash);
@ -436,7 +436,7 @@ bool CPackedStore::Deduplicate(const uint8_t* pEntryBuffer, VPKChunkDescriptor_t
// *workspaceName - // *workspaceName -
// *buildPath - // *buildPath -
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CPackedStore::PackWorkspace(const VPKPair_t& vpkPair, const char* workspaceName, const char* buildPath) void CPackedStoreBuilder::PackWorkspace(const VPKPair_t& vpkPair, const char* workspaceName, const char* buildPath)
{ {
CUtlString workspacePath(workspaceName); CUtlString workspacePath(workspaceName);
workspacePath.AppendSlash(); workspacePath.AppendSlash();
@ -569,7 +569,7 @@ void CPackedStore::PackWorkspace(const VPKPair_t& vpkPair, const char* workspace
// Input : &vpkDirectory - // Input : &vpkDirectory -
// &workspaceName - // &workspaceName -
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CPackedStore::UnpackWorkspace(const VPKDir_t& vpkDir, const char* workspaceName) void CPackedStoreBuilder::UnpackWorkspace(const VPKDir_t& vpkDir, const char* workspaceName)
{ {
CUtlString workspacePath(workspaceName); CUtlString workspacePath(workspaceName);

View File

@ -193,7 +193,7 @@ struct VPKPair_t
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// VPK utility class. // VPK utility class.
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class CPackedStore class CPackedStoreBuilder
{ {
public: public:
void InitLzCompParams(const char* compressionLevel = "default", const lzham_int32 maxHelperThreads = -1); void InitLzCompParams(const char* compressionLevel = "default", const lzham_int32 maxHelperThreads = -1);