MCPatcher.st
changeset 67 32119b00545b
child 255 49df642e079f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MCPatcher.st	Wed Nov 22 14:12:35 2006 +0100
@@ -0,0 +1,50 @@
+"{ 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.1 2006-11-22 13:12:35 cg Exp $'
+! !