# Patchfile

from pandac.PandaModules import Patchfile

Class : Patchfile
Description :

## Inheritance:

Patchfile:

## Methods of Patchfile:

apply
build
getAllowMultifile
getFootprintLength
getProgress
getResultHash
getSourceHash
hasSourceHash
initiate
readHeader
resetFootprintLength
run
setAllowMultifile
setFootprintLength

apply bool Patchfile::apply(Filename &patch_file, Filename &file); Description:

build bool Patchfile::build(Filename file_orig, Filename file_new, Filename patch_name); Description: This implementation uses the "greedy differencing algorithm" described in the masters thesis "Differential Compression: A Generalized Solution for Binary Files" by Randal C. Burns (p.13). For an original file of size M and a new file of size N, this algorithm is O(M) in space and O(M*N) (worst-case) in time.

getAllowMultifile bool Patchfile::get_allow_multifile(void); Description:

getFootprintLength int Patchfile::get_footprint_length(void); Description:

getProgress float Patchfile::get_progress(void) const; Filename: patchfile.I Created by: darren, mike (09Jan97) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . #include "config_downloader.h" Description:

getResultHash HashVal const &Patchfile::get_result_hash(void) const; Description: Returns the MD5 hash for the file after the patch has been applied.

getSourceHash HashVal const &Patchfile::get_source_hash(void) const; Description: Returns the MD5 hash for the source file.

hasSourceHash bool Patchfile::has_source_hash(void) const; Description: Returns true if the MD5 hash for the source file is known. (Some early versions of the patch file did not store this information.)

initiate int Patchfile::initiate(Filename const &patch_file, Filename const &file); PATCH FILE APPLY MEMBER FUNCTIONS NOTE: this patch-application functionality unfortunately has to be duplicated in the Installer. It is contained in the file installerApplyPatch.cxx PLEASE MAKE SURE THAT THAT FILE GETS UPDATED IF ANY OF THIS LOGIC CHANGES! (i.e. if the patch file format changes) Description: Set up to apply the patch to the file (original file and patch are destroyed in the process).

readHeader int Patchfile::read_header(Filename const &patch_file); Description: Opens the patch file for reading, and gets the header information from the file but does not begin to do any real work. This can be used to query the data stored in the patch.

resetFootprintLength void Patchfile::reset_footprint_length(void); Description:

run int Patchfile::run(void); Description: Perform one buffer's worth of patching

setAllowMultifile void Patchfile::set_allow_multifile(bool allow_multifile); Description: If this flag is set true, the Patchfile will make a special case for patching Panda Multifiles, if detected, and attempt to patch them on a subfile-by-subfile basis. If this flag is false, the Patchfile will always patch the file on a full-file basis.

setFootprintLength void Patchfile::set_footprint_length(int length); Description: