# HG changeset patch # User Claus Gittinger # Date 1253729070 -7200 # Node ID a24a9968fdf469651973e1f8f1713db3150e5573 # Parent 908685b92c3e7bc6838d87fde7875c21319fe801 oops: #classFilename was lost with fm's vrany merge diff -r 908685b92c3e -r a24a9968fdf4 Class.st --- a/Class.st Wed Sep 23 18:53:05 2009 +0200 +++ b/Class.st Wed Sep 23 20:04:30 2009 +0200 @@ -700,6 +700,33 @@ "Created: / 12-10-2006 / 15:49:32 / cg" ! + +classFilename + "return the name of the file from which the class was compiled. + If the class was loaded via an explicit load (i.e. from the fileBrowser), + this will be an absolute path. Oherwise, it will be a basename only. + See classBaseFilename for a method which always returns the basename." + + |owner info fn| + + (owner := self owningClass) notNil ifTrue:[^ owner classFilename]. + classFilename notNil ifTrue:[ ^ classFilename ]. + + (info := self revisionInfo) notNil ifTrue:[ + fn := info fileName. + fn notNil ifTrue:[ + ^ fn + ]. + ]. + ^ (Smalltalk fileNameForClass:self), '.st' + + " + Math::ClosedInterval classFilename + " + + "Modified: / 22-10-2008 / 20:58:21 / cg" +! + classPool "return something which allows access to my classVariables via #at: and #at:put: messages." @@ -4942,5 +4969,5 @@ !Class class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.546 2009-09-23 16:38:46 fm Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.547 2009-09-23 18:04:30 cg Exp $' ! !