MCPatcher.st
author Claus Gittinger <cg@exept.de>
Sat, 20 Aug 2011 14:31:21 +0200
changeset 371 53b3d5947d2c
parent 255 49df642e079f
child 667 24a56c13f27e
permissions -rw-r--r--
initial checkin

"{ Package: 'stx:goodies/monticello' }"

Object subclass:#MCPatcher
	instanceVariableNames:'definitions'
	classVariableNames:''
	poolDictionaries:''
	category:'Monticello-Patching'
!


!MCPatcher class methodsFor:'as yet unclassified'!

apply: aPatch to: aSnapshot
	| loader |
	loader := self snapshot: aSnapshot.
	aPatch applyTo: loader.
	^ loader patchedSnapshot
!

snapshot: aSnapshot
	^ self new initializeWithSnapshot: aSnapshot
! !

!MCPatcher methodsFor:'as yet unclassified'!

addDefinition: aDefinition
	definitions add: aDefinition
!

initializeWithSnapshot: aSnapshot
	definitions := MCDefinitionIndex definitions: aSnapshot definitions
!

modifyDefinition: baseDefinition to: targetDefinition
	self addDefinition: targetDefinition
!

patchedSnapshot
	^ MCSnapshot fromDefinitions: definitions definitions
!

removeDefinition: aDefinition
	definitions remove: aDefinition
! !

!MCPatcher class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatcher.st,v 1.3 2011-08-20 12:31:21 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCPatcher.st,v 1.3 2011-08-20 12:31:21 cg Exp $'
!

version_SVN
    ^ '§Id: MCPatcher.st 5 2010-08-29 07:30:29Z vranyj1 §'
! !