Skip to content

Commit

Permalink
Renamed initializeFromArchive() with a buffer to initializeFromBuffer().
Browse files Browse the repository at this point in the history
Also pass a constant buffer reference rather than a buffer reference (which is needed by the unzipper).
  • Loading branch information
agarny committed Jun 4, 2024
1 parent f51320e commit 2fd6d7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/combine/combinearchive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,17 @@ CombineArchive::initializeFromArchive(
}

bool
CombineArchive::initializeFromArchive(
std::vector<unsigned char>& pBuffer,
CombineArchive::initializeFromBuffer(
const std::vector<unsigned char>& pBuffer,
bool skipOmex /*= false*/)
{
cleanUp();

try
{
mpUnzipper = new Unzipper(pBuffer);
auto buffer = const_cast<std::vector<unsigned char> &>(pBuffer);

mpUnzipper = new Unzipper(buffer);
}
catch (const std::exception&)
{
Expand Down
4 changes: 2 additions & 2 deletions src/combine/combinearchive.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ class LIBCOMBINE_EXTERN CombineArchive
*
* @return boolean indicating success or failure
*/
bool initializeFromArchive(std::vector<unsigned char>& pBuffer,
bool skipOmex=false);
bool initializeFromBuffer(const std::vector<unsigned char>& pBuffer,
bool skipOmex=false);

/**
* @return the manifest
Expand Down

0 comments on commit 2fd6d7b

Please sign in to comment.