|
Class: Class
Object
|
+--Behavior
|
+--ClassDescription
|
+--Class
|
+--JavaScriptClass
|
+--SmalltalkShareClient::RemoteClass
|
+--Trait
- Package:
- stx:libbasic
- Category:
- Kernel-Classes
- Version:
- rev:
1.761
date: 2024/02/25 13:14:09
- user: cg
- file: Class.st directory: libbasic
- module: stx stc-classLibrary: libbasic
Class adds more functionality to classes; minimum stuff has already
been defined in Behavior and ClassDescription; this adds naming, categories etc.
[Instance variables:]
name <Symbol> the classes name
category <Symbol> the classes category
classvars <String> the names of the class variables;
| <Collection of words> initially, stc generates a string; this is converted on the fly
to an array of names. In the future, stc may be changed.
comment <String> the classes comment; either a string,
a number specifying the offset in classFilename, or nil
subclasses <Collection> cached collection of subclasses
(not used for execution, but for the IDE to speed up certain operations)
classFilename <String> the file (or nil) where the classes' sources are found
package <Symbol> the package, in which the class was defined (inserted by compilers)
revision <String> revision string - inserted by stc
environment <Symbol | nil> cached environment (i.e. Smalltalk or a namespace)
signature <SmallInteger> the classes signature (used to detect obsolete or changed classes with binaryStorage)
This is filled in lazy - i.e. upon the first signature query.
attributes <Array | nil> describes primitiveIncludes, primitiveFunctions etc.
also a place to add additional attributes, without a need to recompile all classes.
WARNING: layout known by compiler and runtime system
[note:]
the subclasses instvar keeps a cached collection of the known subclasses in the system.
this cache is lazyly flushed when a SubclassCacheSequenceNumber comparison detects a mismatch.
(this seqNr is incremented, whenever something in any class hierarchy changes).
This is a q&d mechanism to allow for no-overhead fileIn and package loading,
and reasonable speedup in the hierarchy walkers (i.e. the browsers).
(flushing all is obviously too much flushing, and we could do better in many situations)
copyrightCOPYRIGHT (c) 1989 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
accessing-flags
-
tryLocalSourceFirst
-
if true (now the default), local source files are tried first, before a sourceCodemanager is
consulted. This may speed up the source access, but adds some insecurity, because
the sourceCodemanager is always getting the source for the classes correct version.
In contrast, the local file might be different from (edited in an external tool) in
the meantime. You have been warned - better leave it false (the sourceCodemanager will
fill its cache and eventually be just as fast...)
-
tryLocalSourceFirst: aBoolean
-
if true (which is the default), local source files are tried first, before a sourceCodemanager is
consulted. This may speed up the source access, but adds some insecurity, because
the sourceCodemanager is always getting the source for the classes correct version.
In contrast, the local file might be different from (edited in an external tool) in
the meantime. You have been warned - better leave it false (the sourceCodemanager will
fill its cache and eventually be just as fast...)
-
updateChanges: aBoolean
-
turn on/off changes management. Return the prior value of the flag.
This value is used as a default fallback - a querySignal handler may still
decide to return something else.
-
updatingChanges
-
return true if changes are recorded.
The value returned here is the default fallback - a querySignal handler may still
decide to return something else.
creating new classes
-
name: newName
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
name: newName instanceVariableNames: stringOfInstVarNames
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
name: newName subclassOf: aClass
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames category: categoryString
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames classVariableNames: stringOfClassVarNames category: categoryString
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames classVariableNames: stringOfClassVarNames classInstanceVariableNames: stringOfClassInstVarNames poolDictionaries: stringOfPoolNames category: categoryString
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
name: newName subclassOf: aClass instanceVariableNames: stringOfInstVarNames classVariableNames: stringOfClassVarNames poolDictionaries: stringOfPoolNames category: categoryString
-
this new instance creation protocol may be used in scripts to replace the traditional inst-creation messages
-
undeclared: name
-
Creates an 'undeclared' class, a placeholder for
superclass when loading/filing-in a class whose
superclass does not exist yet.
helpers
-
nameWithoutPrefix: name
-
helper for fileOut and others - return a name's printString,
without any owningClass or nameSpace prefix
Usage example(s):
a public class:
Class nameWithoutPrefix:'Array'
Class nameWithoutPrefix:'Tools::Array'
|
-
revisionInfoFromString: aString
-
return a revision info, given a string.
This extracts the relevant info from aString, asking
the default sourceCode manager (if there is one).
Notice, that this method is only invoked, if a class does not know
its sourceCode manager.
-
revisionStringFromSource: aMethodSourceString
-
extract a revision string from a method's source string.
Caveat: Assumes CVS.
misc
-
template: aCategoryString
-
return a class-definition template
private
-
flushSubclassInfo
-
throw away (forget) the cached subclass information,
as created by #subclassInfo.
This is private protocol
Usage example(s):
-
flushSubclassInfoFor: aClass
-
throw away (forget) the cached subclass information for aClass,
as created by #subclassInfo.
This is private protocol
Usage example(s):
Class flushSubclassInfoFor:View
|
queries
-
isBuiltInClass
-
return true if this class is known by the run-time-system.
Here, true is returned for myself, false for subclasses.
Compatibility-Dolphin
-
defaultCategoryForDolphinClasses
-
used only when filing in Dolphin classes (which do not provide a category in their inst creation message)
-
guid
-
-
guid: aUUID
-
(comment from inherited method)
Compatibility method - do not use in new code.
An ignored dummy; for Dolphin compatibility.
-
stb_version
-
-
subclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s classInstanceVariableNames: classInstanceVariableNames
-
this method allows fileIn of Dolphin classes
-
variableSubclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s classInstanceVariableNames: classInstanceVariableNames
-
this method allows fileIn of Dolphin classes
Compatibility-ST/V and V'Age
-
defaultCategoryForSTVorVAGEClasses
-
used only when filing in ST/V and V'Age classes (which do not provide a category in their inst creation message)
-
subclass: nm classInstanceVariableNames: cIV instanceVariableNames: iV classVariableNames: cV poolDictionaries: p
-
this method allows fileIn of ST/V and V'Age classes
-
subclass: nm instanceVariableNames: iV classVariableNames: cV poolDictionaries: pD
-
this method allows fileIn of ST/V and V'Age classes
(which seem to have no category)
-
variableByteSubclass: t classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable byte classes
(which seem to have no category and no instvars)
-
variableLongSubclass: t classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable long (32bit integers) classes
(which seem to have no category and no instvars)
-
variableSubclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable pointer classes
(which seem to have no category)
-
variableWordSubclass: t classVariableNames: d poolDictionaries: s
-
this method allows fileIn of ST/V and V'Age variable word (16bit integers) classes
(which seem to have no category and no instvars)
Compatibility-ST80
-
classPool
-
return something which allows access to my classVariables via
#at: and #at:put: messages.
Usage example(s):
-
fileOutSourceOn: aStream
-
-
rename: newName
-
same as renameTo: - for ST80 compatibility
Compatibility-Squeak
-
bindingOf: aName
( an extension from the stx:libcompat package )
-
return the binding of a name - either a class var, a private class, or a pool value
Usage example(s):
JV@2011-10-23: In Squeak/Pharo, bindingOf: returns
nil if no binding is found. Some code depends on this
behavior
|
-
classComment: comment stamp: commentStamp
-
-
commentStamp: stampString prior: priorVersion
-
(comment from inherited method)
return a ClassCategoryReader to read in and compile methods for me.
This was added to allow squeak code to be filedIn.
-
objectForDataStream: stream
( an extension from the stx:libcompat package )
-
-
storeDataOn: stream
( an extension from the stx:libcompat package )
-
(comment from inherited method)
Store myself on a DataStream.
Answer self.
This is a low-level DataStream/ReferenceStream method.
See also objectToStoreOnDataStream.
NOTE: This method must send 'aDataStream beginInstance:size:' and then (nextPut:/nextPutWeak:) its subobjects.
readDataFrom:size: reads back what we write here.
-
ultimateSourceCodeAt: aSelector ifAbsent: exceptionalValue
( an extension from the stx:libcompat package )
-
Return the source code at selector, deferring to superclass if necessary
Usage example(s):
Array ultimateSourceCodeAt:#class ifAbsent:[nil]
Array ultimateSourceCodeAt:#foo ifAbsent:[nil]
|
Compatibility-VW
-
defineSharedVariable: name private: private constant: constant category: category initializer: initializer
-
must add to the class-initialize method:
-
defineStatic: name private: private constant: constant category: category initializer: initializer attributes: annotations
-
-
sortedSubclasses
-
accessing
-
addClassVarName: aStringOrSymbol
-
add a class variable if not already there and initialize it with nil.
Also writes a change record and notify dependents.
-
addClassVarNames: aCollectionOfStrings
-
add a number of class variables if not already there and initialize them with nil.
Also writes a change record and notifies dependents.
-
allPrivateClasses
-
return a collection of all private classes and private-private classes.
The classes are in any order.
-
category
-
return the category of the class.
The returned value may be a string or symbol.
Usage example(s):
Point category
Dictionary category
|
-
category: aStringOrSymbol
-
set the category of the class to be the argument, aStringOrSymbol.
Sends out change notifications, so browers can update
-
classBaseFilename
-
return the baseName of the file from which the class was compiled.
In contrast to classFilename, this will always be a plain basename.
-
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.
Usage example(s):
SVN::Repository classFilename
Array classFilename
|
-
classNamed: aClassNameStringOrSymbol
-
return a private class if present; nil otherwise.
Added for protocol compatibilty with NameSpace and Smalltalk
-
classVarAt: aSymbolOrNameString
-
return the value of a class variable.
Currently, this returns nil if there is no such classvar -
this may change.
Usage example(s):
Object classVarAt:#UserInterruptSignal
Object classVarAt:'UserInterruptSignal'
|
-
classVarAt: aSymbol ifAbsent: exceptionBlock
-
return the value of a class variable.
Currently, this returns nil if there is no such classvar -
this may change.
-
classVarAt: aSymbolOrString put: something
-
store something in a classvariable.
Currently this creates a global with a funny name if no such
classVar exists - this may change.
-
classVarNames
-
return a collection of the class variable name-strings.
Only names of class variables defined in this class are included
in the returned collection - use allClassVarNames, to get all known names.
Traditionally, this was called classVarNames, but newer versions of squeak
seem to have changed to use classVariableNames.
So you probably should use the alias
Usage example(s):
Object classVarNames
Float classVarNames
|
-
classVariableString
-
return a string of the class variables names.
Only names of class variables defined in this class are in the
returned string.
Usage example(s):
Object classVariableString
Float classVariableString
|
-
classVariableString: aString
-
set the classes classvarnames string;
Initialize new class variables with nil, clear and remove old ones.
No change record is written and no classes are recompiled.
-
comment
-
return the comment (aString) of the class
Usage example(s):
the comment is either a string, or an integer specifying the
position within the classes sourcefile ...
|
Usage example(s):
Object comment
RunArray comment
|
-
comment: aStringOrNil
-
set the comment of the class to be the argument, aString;
create a change record and notify dependents.
-
containingNameSpace
-
return the namespace I am really contained in;
For private or anonymous classes, nil is returned -
for public classes, Smalltalk is returned.
-
environment
-
return the namespace I am contained in; ST-80 compatible name
-
generateClassFilename
-
generate the expected filename for this class - without suffix.
This may be different from the actual classFilename
Usage example(s):
Complex generateClassFilename
HTML::AbstractElement generateClassFilename
|
-
getClassFilename
-
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.
-
getPackage
-
get the package or nil.
-
globalKeyForClassVar: aStringOrSymbol
-
this helps to encapsulate the (current) implementation of classVariables
from the outside world. Currently, classvars are stored in
the Smalltalk dictionary with a funny name, since there are
no classPools yet.
-
name
-
return the name of the class.
This returns a symbol (but notice, that other smalltalks might return a string).
-
nameSpace
-
return the namespace I am contained in;
For public classes, Smalltalk is returned.
For private classes, the owning class is returned.
For anonymous classes, nil should be returned - but for now, this also returns Smalltalk;
but will change in the future to return nil then.
This is left in for a while (because many users of this method expect a non-nil return value).
In the meantime, use containingNameSpace, which provides the correct answer
Usage example(s):
Expecco::KeyFile::Extension setEnvironment:nil.
Expecco::KeyFile::Extension nameSpace
Expecco::KeyFile::Extension containingNameSpace
|
-
package
-
return the package-symbol of the class.
Usage example(s):
-
package: aSymbol
-
set the package-symbol of the class.
Sends out change notifications, so browers can update
-
poolDictionaries
-
this returns the concatenated pool name string
-
primitiveDefinitions: aString
-
set the primitiveDefinition string
-
primitiveDefinitionsString
-
return the primitiveDefinition string or nil
Usage example(s):
Object primitiveDefinitionsString
String primitiveDefinitionsString
|
-
primitiveDefinitionsStringOrDefault
-
return the primitiveDefinition string or a default
Usage example(s):
Object primitiveDefinitionsStringOrDefault
String primitiveDefinitionsStringOrDefault
ExternalStream primitiveDefinitionsStringOrDefault
|
-
primitiveFunctions: aString
-
set the primitiveFunction string
-
primitiveFunctionsString
-
return the primitiveFunctions string or nil
-
primitiveFunctionsStringOrDefault
-
return the primitiveFunction string or a default
Usage example(s):
Object primitiveFunctionsStringOrDefault
String primitiveFunctionsStringOrDefault
ExternalStream primitiveFunctionsStringOrDefault
|
-
primitiveVariables: aString
-
set the primitiveVariable string
-
primitiveVariablesString
-
return the primitiveVariables string or nil
-
primitiveVariablesStringOrDefault
-
return the primitiveVariable string or a default
Usage example(s):
Object primitiveVariablesStringOrDefault
String primitiveVariablesStringOrDefault
ExternalStream primitiveVariablesStringOrDefault
|
-
privateClassNamed: aClassNameStringOrSymbol
-
-
privateClasses
-
return a collection of my private classes (empty, if I have none).
The classes are in any order.
Usage example(s):
Object privateClasses
ObjectMemory privateClasses
UILayoutTool privateClasses
|
-
privateClassesAt: aClassNameStringOrSymbol
-
return a private class if present; nil otherwise
-
privateClassesAt: aClassNameStringOrSymbol put: aClass
-
add a private class
-
privateClassesOrAll: allOfThem
-
return a collection of my direct private classes (if any)
or direct plus indirect private classes (if allOfThem).
An empty collection if there are none.
The classes are in no particular order.
Usage example(s):
UILayoutTool privateClassesOrAll:true
UILayoutTool privateClassesOrAll:false
|
-
privateClassesSorted
-
return a collection of my private classes (if any).
The classes are sorted by inheritance.
Usage example(s):
Object privateClassesSorted
Class privateClassesSorted
Class privateClasses
|
-
projectDefinition
-
return the project definition of the classes package
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
projectDefinitionClass
-
return the project definition of the classes' package.
Eg. for Array, this would return the stx_libbasic project definition class.
Usage example(s):
Object projectDefinitionClass productVersion
DAPASX::DapasUI projectDefinitionClass productVersion
|
-
realSharedPoolNames
-
this returns the namespace aware pool names
-
realSharedPools
-
this returns the namespace aware pools
Usage example(s):
Croquet::OpenGL sharedPools
Croquet::OpenGL realSharedPools
Win32OperatingSystem realSharedPools
Win32OperatingSystem realSharedPoolNames
|
-
removeClassVarName: aString
-
remove a class variable if not already there.
Also writes a change record and notifies dependents.
-
setCategory: aStringOrSymbol
-
set the category of the class to be the argument, aStringOrSymbol.
Does NOT send out change notifications (so browers will NOT update)
-
setClassFilename: aFilename
-
set the classes filename.
This is a dangerous (low level) operation,
since the comment and primitiveSpecs may no longer be accessible,
if a wrong filename is set here.
-
setClassVariableString: aString
-
set the classes classvarnames string.
This is a dangerous (low level) operation, since the
classvariables are not really created or updated. Also,
NO change record is written.
-
setComment: aString
-
set the comment of the class to be the argument, aString;
do NOT create a change record
-
setComment: com category: categoryStringOrSymbol
-
set the comment and category of the class;
do NOT create a change record
-
setEnvironment: aNamespace
-
set the namespace I am contained in; ST-80 compatible name
-
setPackage: aSymbol
-
set the package of the class.
Does NOT send out change notifications (so browers will NOT update)
-
sharedPoolNames
-
this returns a collection of the plain (non-namespace aware) pool names.
Read the comment in sharedPools on why this is done.
Usage example(s):
ZipArchive sharedPoolNames
OSI::ASN1_Coder sharedPoolNames
Croquet::OpenGL sharedPoolNames
OpenGLRenderingContext sharedPoolNames
Character sharedPoolNames
Win32OperatingSystem sharedPoolNames
|
-
sharedPoolNames: aStringOrCollection
-
set the sharedPools string (no change notifications)
Does NOT send out change notifications (so browers will NOT update)
-
sharedPools: aCollection
-
set the sharedPools expects the real pools (i.e. the PoolDictionaries)
-
source
-
return the classes full source code
-
sourceCodeManager
-
Return my (configured) source code manager.
Usage example(s):
Array sourceCodeManager
foo_p1 sourceCodeManager
|
-
sourceCodeManagerFromBinaryRevision
-
Returns the source code manager that should be used for
source code access based in class's binary revision.
If no binary revision is available, then the configured source
code manager is returned.
If source code management is disabled,
or a particular source code manager is not enabled, return nil.
The source code manager for source access may differ from the
configured source code manager:
- #sourceCodeManager returns the manager use has configured for
this class using preferences
- #sourceCodeManagerForSourceAccess is the manager used when asking
for class source code. It compares version_XXX methods with
the class's binary revision and. When method_XXX matches the
binary revision string, XXX source code manager is returned,
as this class has been likely compiled from a source checked out
using returned source code manager
CAVEAT: Now, the code expects that the revision string is in
the format '$revision ident$SCM'. It won't work for managers that
do not use dollar expansion. For now, only CVS, SVN and Perforce
are used so this code should work
-
subclasses
-
return a collection of the direct subclasses of the receiver
Usage example(s):
subclasses may still be nil - obsolete classes may not be updated
|
Usage example(s):
Class flushSubclassInfo.
Class subclasses.
SmallInteger subclasses
|
-
superclass: aClass
-
set the superclass - this actually creates a new class,
recompiling all methods for the new one. The receiving class stays
around anonymously to allow existing instances some life.
This may change in the future (adjusting existing instances)
-
traitUsers
-
Trait traitUsers
-
traitUsers: aSetOrNi
-
Trait traitUsers
-
withAllPrivateClasses
-
return a collection containing the receiver plus all of my private classes (if any).
This also inclueds all private classes of private classes, recursively.
Elements are in no particular order.
adding & removing
-
removeFromSystem
-
ST-80 compatibility
remove myself from the system
-
unload
-
if the receiver was autoloaded, unload and reinstall it as
autoloaded. Can be used to get rid of no longer needed autoloaded
classes.
(maybe, autoloaded classes should unload themselfes when no
longer needed - for example, after some delay when the last instance
is gone ...)
Usage example(s):
if the receiver was autoloaded, unload and reinstall it as
autoloaded. Can be used to get rid of no longer needed autoloaded
classes.
(maybe, autoloaded classes should unload themselfes when no
longer needed - for example, after some delay when the last instance
is gone ...)
|
Usage example(s):
cannot unload, if non-autoloaded subclasses exist ...
|
Usage example(s):
Clock open.
Clock unload.
ClockView unload.
Clock open
|
changes management
-
addChangeRecordForChangeCategory
-
add a category change
-
addChangeRecordForClass: aClass
-
add a class-definition-record to the changes file
-
addChangeRecordForClass: aClass andNotifyChangeOf: aspect
-
writes a change record and notifies dependents.
-
addChangeRecordForClassCheckIn: aClass
-
append a class-was-checkedIn-record to the changes file
-
addChangeRecordForClassComment: aClass
-
add a class-comment-record to the changes file
-
addChangeRecordForClassContainerRemove: aClass
-
append a container-was-removed-record to the changes file
-
addChangeRecordForClassFileOut: aClass
-
append a class-was-filedOut-record to the changes file
-
addChangeRecordForClassInstvars: aClass
-
add a class-instvars-record to the changes file
-
addChangeRecordForClassRemove
-
add a class-remove-record to the changes file
-
addChangeRecordForClassRemove: oldClassName
-
add a class-remove-record to the changes file
-
addChangeRecordForClassRename: oldName to: newName
-
add a class-rename-record to the changes file
-
addChangeRecordForClassTagged: aClass asBranch: asBranch symbolicName: symbolicVersionTag
-
append a class-was-tagged-record to the changes file
-
addChangeRecordForPrimitiveDefinitions: aClass
-
add a primitiveDefinitions-record to the changes file
-
addChangeRecordForPrimitiveFunctions: aClass
-
add a primitiveFunctions-record to the changes file
-
addChangeRecordForPrimitiveVariables: aClass
-
add a primitiveVariables-record to the changes file
-
addChangeRecordForSnapshot: aFileName
-
add a snapshot-record to the changes file
-
addChangeRecordForSnapshot: aFileName to: aStream
-
add a snapshot-record to aStream
enumerating
-
allPrivateClassesDo: aBlock
-
evaluate aBlock on all of my private classes (if any).
Evaluation is in no particular order.
-
privateClassesDo: aBlock
-
evaluate aBlock on all of my (immediate) private classes (if any).
Evaluation is in no particular order.
-
subclassesDo: aBlock
-
evaluate the argument, aBlock for all immediate subclasses.
This will only enumerate globally known classes - for anonymous
behaviors, you have to walk over all instances of Behavior.
Usage example(s):
Collection subclassesDo:[:c | Transcript showCR:(c name)]
|
-
withAllPrivateClassesDo: aBlock
-
evaluate aBlock on myself and all of my private classes (if any).
This recurses into private classes of private classes.
Evaluation is in no particular order.
fileIn interface
-
primitiveDefinitions
-
this method allows fileIn of classes with primitive code.
It returns a CCReader which reads the next chunks and installs the
unprocessed contents in the classes primitiveDefinitions section.
Thus, although the definitions are NOT processed, they are still visible,
editable and especially: not lost when filing out the class.
-
primitiveFunctions
-
this method allows fileIn of classes with primitive code.
It returns a CCReader which reads the next chunks and installs the
unprocessed contents in the classes primitiveFunctions section.
Thus, although the functions are NOT processed, they are still visible,
editable and especially: not lost when filing out the class.
-
primitiveVariables
-
this method allows fileIn of classes with primitive code.
It returns a CCReader which reads the next chunks and installs the
unprocessed contents in the classes primitiveVariables section.
Thus, although the variables are NOT processed, they are still visible,
editable and especially: not lost when filing out the class.
fileOut
-
basicFileOutDefinitionOn: aStream withNameSpace: forceNameSpace
-
append an expression on aStream, which defines myself.
-
basicFileOutDefinitionOn: aStream withNameSpace: forceNameSpace withPackage: showPackage
-
append an expression on aStream, which defines myself.
-
basicFileOutDefinitionOn: aStream withNameSpace: forceNameSpace withPackage: showPackage syntaxHilighting: syntaxHilighting
-
append an expression on aStream, which defines myself.
-
basicFileOutInstvarTypeKeywordOn: aStream
-
a helper for fileOutDefinition
-
fileOut
-
create a file 'class.st' consisting of all methods in myself in
sourceForm, from which the class can be reconstructed (by filing in).
If the current project is not nil, create the file in the projects
directory. Care is taken, to not clobber any existing file in
case of errors (for example: disk full).
Also, since the classes methods need a valid sourcefile, the current
sourceFile may not be rewritten.
-
fileOutAllMethodsOn: aStream
-
-
fileOutAllMethodsOn: aStream methodFilter: methodFilter
-
-
fileOutAs: filenameString
-
create a file consisting of all methods in myself in
sourceForm, from which the class can be reconstructed (by filing in).
The given fileName should be a full path, including suffix.
Care is taken, to not clobber any existing file in
case of errors (for example: disk full).
Also, since the classes methods need a valid sourcefile, the current
sourceFile may not be rewritten.
-
fileOutClassInstVarDefinitionOn: aStream
-
append an expression to define my classInstanceVariables on aStream
-
fileOutClassInstVarDefinitionOn: aStream withNameSpace: withNameSpace
-
append an expression to define my classInstanceVariables on aStream
-
fileOutCommentOn: aStream
-
append an expression on aStream, which defines my comment
-
fileOutDefinitionOn: aStream
-
append an expression on aStream, which defines myself.
-
fileOutIn: aDirectoryName
-
create a file 'class.st' consisting of all methods in self in
directory aDirectoryName (ignoring any directory setting in
the current project).
This is not logged in that change file (should it be ?).
Returns the fileName into which the class was stored
Usage example(s):
self fileOutIn:'/tmp'
self fileOutIn:'/tmp/doesNotExistBla'
self fileOutIn:'/tmp' asFilename
|
-
fileOutIn: aDirectoryName withTimeStamp: withTimeStamp
-
create a file 'class.st' consisting of all methods in self in
directory aDirectoryName (ignoring any directory setting in
the current project).
This is not logged in that change file (should it be ?).
Returns the fileName into which the class was stored
Usage example(s):
self fileOutIn:'/tmp'
self fileOutIn:'/tmp/doesNotExistBla'
self fileOutIn:'/tmp' asFilename
|
-
fileOutOn: aStream
-
file out my definition and all methods onto aStream
-
fileOutOn: aStream withTimeStamp: stampIt
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
-
fileOutOn: aStream withTimeStamp: stampIt withInitialize: initIt
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
-
fileOutOn: aStream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter: methodFilter
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
The order by which the fileOut is done is used to put the version string at the end.
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move
-
fileOutOn: outStreamArg withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter: methodFilter encoder: encoderOrNil
-
file out my definition and all methods onto aStream.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
The order by which the fileOut is done is used to put the version string at the end.
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move
-
fileOutPrimitiveDefinitionsOn: aStream
-
append primitive defs (if any) to aStream.
-
fileOutPrimitiveFunctionsOn: aStream
-
primitive functions - if any
-
fileOutPrimitiveSpecsOn: aStream
-
append primitive defs (if any) to aStream.
fileOut-binary
-
binaryFileOut
-
create a file 'class.cls' (in the current projects fileOut-directory),
consisting of all methods in myself in a portable binary format.
The methods sources are saved by reference
to the classes sourceFile if there is any.
That sourcefile needs to be present after reload in order to be
browsable.
-
binaryFileOutOn: aStream
-
append a binary representation of myself to aStream
-
binaryFileOutWithSourceMode: sourceMode
-
create a file 'class.cls' (in the current projects fileOut-directory),
consisting of all methods in myself in a portable binary format.
The argument controls how sources are to be saved:
#keep - include the source
#reference - include a reference to the sourceFile
#discard - don't save sources.
With #reference, the sourceFile needs to be present after reload
in order to be browsable.
-
binaryFileOutWithSourceMode: sourceMode as: fileNameString
-
create a file fileNameString,
consisting of all methods in myself in a portable binary format.
The argument controls how sources are to be saved:
#keep - include the source
#reference - include a reference to the sourceFile
#discard - don't save sources.
With #reference, the sourceFile needs to be present after reload
in order to be browsable.
fileOut-xml
-
fileOutXML
-
create a file 'class.xml' consisting of all methods in myself in
XML sourceForm.
If the current project is not nil, create the file in the projects
directory. Care is taken, to not clobber any existing file in
case of errors (for example: disk full)
Usage example(s):
-
fileOutXMLAllDefinitionsOn: aStream
-
append xml expressions on aStream, which defines myself and all of my private classes.
-
fileOutXMLAllMethodsOn: aStream methodFilter: methodFilter
-
-
fileOutXMLAs: fileNameOrString
-
create a file consisting of all methods in myself in
XML sourceForm.
The given fileName should be a full path, including suffix.
Usage example(s):
Class fileOutXMLAs:'test.xml'
Class fileOutXMLAs:'/blaDoesNotExist/test.xml'
|
-
fileOutXMLDefinitionOn: aStream
-
append an xml expression on aStream, which defines myself.
-
fileOutXMLOn: aStream
-
WARNING: untested first version. Not for general use (yet)
file out my definition and all methods onto aStream in XML format.
-
fileOutXMLOn: aStream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter: methodFilter
-
WARNING: untested first version. Not for general use (yet)
file out my definition and all methods onto aStream in XML format.
If stampIt is true, a timeStamp comment is prepended.
If initIt is true, and the class implements a class-initialize method,
append a corresponding doIt expression for initialization.
The order by which the fileOut is done is used to put the version string at the end.
Thus, if the version string is expanded (by CVS), the characterPositions of methods should not move
Usage example(s):
Class
fileOutXMLOn:'test.xml' asFilename writeStream
withTimeStamp:true
withInitialize:true
withDefinition:true
methodFilter:nil
|
inspecting
-
inspector2TabDocumentation
( an extension from the stx:libtool package )
-
Array inspect
misc ui support
-
defaultIconForAboutBox
( an extension from the stx:libwidg package )
-
-
inspectorClass
( an extension from the stx:libtool package )
-
redefined to launch a ClassInspector, which knows about classVariables
(instead of the default InspectorView).
printing & storing
-
htmlDocumentation
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
printClassVarNamesOn: aStream indent: indent
-
print the class variable names indented and breaking at line end
-
printFullHierarchyOn: aStream indent: indent
-
print myself and all subclasses on aStream.
recursively calls itself to print subclasses.
Can be used to print hierarchy on the printer.
Usage example(s):
|printStream|
printStream := Printer new.
Object printFullHierarchyOn:printStream indent:0.
printStream close
|
-
printOutDefinitionOn: aPrintStream
-
print out my definition
-
printOutOn: aPrintStream
-
print out all methods on aPrintStream which should be a printStream
-
printOutProtocolOn: aPrintStream
-
-
printSharedPoolNamesOn: aStream indent: indent
-
print the pool names indented and breaking at line end
-
storeOn: aStream
-
append my name only - expects class to be there, when restoring
private-accessing
-
attributes
-
return the extra class attributes or nil
-
attributes: aClassAttributesObject
-
set the extra class attributes
-
classAttributes
-
return the extra class attributes or create them if nil.
Notice that the stc-compiler is too stupid to generate instances of ClassAttributes directly;
therefore, it generates arrays which are converted here, when we first access the attribute.
-
classAttributes: aClassAttributesObject
-
set the extra class attributes
-
classAttributesOrNil
-
return the extra class attributes or nil
-
flushSubclasses
-
-
getAttribute: aKey
-
get an attribute (by symbolic key)
-
getAttribute: aKey ifAbsent: exceptionValue
-
get an attribute (by symbolic key)
-
getSourceChunkAttribute: aKey
-
the attribute is either a string, or an integer specifying the
position within the classes sourcefile ...
-
setAttribute: key to: aValue
-
Modified (format): / 02-06-2023 / 01:05:37 / exept MBP
-
setName: aString
-
set the classes name - be careful, it will be still
in the Smalltalk dictionary - under another key.
This is NOT for general use - see renameTo:
-
setPrimitiveDefinitions: aString
-
set the primitiveDefinition string (no change notifications)
-
setPrimitiveFunctions: aString
-
set the primitiveFunction string (no change notifications)
-
setPrimitiveVariables: aString
-
set the primitiveVariable string (no change notifications)
-
setSharedPoolNames: aStringOrCollection
-
set the sharedPools string (no change notifications)
-
setSubclasses: aCollection
-
-
updateAllCachedSubclasses
-
Class updateAllCachedSubclasses.
Object subclasses
Array subclasses
private-changes management
-
addChangeRecordForChangeCategory: category to: aStream
-
append a category change record to aStream
-
addChangeRecordForClass: aClass to: aStream
-
append a class-definition-record to aStream
-
addChangeRecordForClassComment: aClass to: aStream
-
append a class-comment-record to aStream
-
addChangeRecordForClassInstvars: aClass to: aStream
-
append an instvars-record to aStream
-
addChangeRecordForClassRemove: oldClass to: aStream
-
append a class-remove-record to aStream
-
addChangeRecordForClassRename: oldName to: newName to: aStream
-
append a class-rename-record to aStream
-
addChangeRecordForPrimitiveDefinitions: aClass to: aStream
-
append a primitiveDefinitions-record to aStream
-
addChangeRecordForPrimitiveFunctions: aClass to: aStream
-
append a primitiveFunctions-record to aStream
-
addChangeRecordForPrimitiveVariables: aClass to: aStream
-
append a primitiveVariables-record to aStream
queries
-
canHaveExtensions
-
return true, if this class allows extensions from other packages.
Private classes, namespaces and projectDefinitions don't allow this
Usage example(s):
Smalltalk allClasses select:[:each | each canHaveExtensions not]
|
-
classResources
-
thisContext isRecursive ifTrue:[^ ResourcePack new].
-
defaultCategoryForUncategorizedClasses
-
used only when the short scripting class creation messages are used
-
defaultCategoryForUndeclaredClasses
-
-
extensions
-
return a collection of extension-methods (both class and inst) from any other package,
or empty if there are none.
Unassigned methods are ignored
Usage example(s):
CType extensions
Rectangle extensions
Rectangle hasExtensions
Object extensions
Object hasExtensions
|
-
extensionsFrom: aPackageID
-
return the set of extension-methods (both class and inst) from the given package.
Usage example(s):
CType extensionsFrom:#'bosch:dapasx'
Rectangle extensionsFrom:#'bosch:dapasx/support'
Rectangle extensions
Class extensions
Class extensionsFrom:#'stx:libboss'
|
-
hasExtensions
-
return true, if there are methods in the receiver, which belong to
a different package (i.e. package of class ~= package of method).
Those are class extensions, which must be treated specially when checking classes
into the sourceCode repository. (extensions are stored separate).
Unassigned extensions are ignored here (i.e. as yet unpackaged changes)
Usage example(s):
Time millisecondsToRun:[
Smalltalk allClasses select:[:each | each hasExtensions]
].
Dictionary
withAssociations:
(Smalltalk allClasses
select:[:each | each hasExtensions]
thenCollect:[:each | each -> each extensions])
|
-
hasExtensionsFrom: aPackageID
-
return true, if there are methods in the receiver, which belong to
the package with aPackageID (i.e. package of class ~= package of method).
Those are class extensions, which must be treated specially when checking classes
into the sourceCode repository. (extensions are stored separate)
Usage example(s):
Smalltalk allClasses
select:[:each | each hasExtensionsFrom:'stx:goodies/refactyBrowser']
Smalltalk allClasses
select:[:each | each hasExtensionsFrom:'stx:libboss']
|
-
hasUnassignedExtensions
-
return true, if there are methods in the receiver, which have not been
assigned to any package.
Usage example(s):
Time millisecondsToRun:[
Smalltalk allClasses select:[:each | each hasUnassignedExtensions]
]. 190 130 260
Dictionary
withAssociations:
(Smalltalk allClasses
select:[:each | each hasUnassignedExtensions]
thenCollect:[:each | each -> each unassignedExtensions])
|
-
hasUnsavedChanges
-
return true, if there are changes for this class in the current changeSet
Usage example(s):
Class hasUnsavedChanges
Array hasUnsavedChanges
|
-
isBrowserStartable
-
return true, if this is an application class,
which can be started from the browser
-
isClass
-
return true, if the receiver is some kind of class
(a real class, not just behavior);
true is returned here - the method is redefined from Object.
See also Behavior>>isBehavior.
Usage example(s):
Point isClass
1 isClass
Behavior new isBehavior
Behavior new isClass
Class new isBehavior
Class new isClass
|
-
isJavaScriptClass
-
(comment from inherited method)
return true if this is a JavaScriptClass.
false is returned here - the method is only redefined in JavaScriptClass.
-
isStartableWithMain
-
return true, if this is an application class,
which can be started via #main / #main:
-
isStartableWithStart
-
return true, if this is an application class,
which can be started via #start
-
logFacility
-
the 'log facility';
this is used by the Logger both as a prefix to the log message,
and maybe (later) used to filter and/or control per-facility log thresholds.
The default here is to base the facility on the classname prefixed by the package:
if the class is anywhere in the base ST/X system, 'STX' is returned as facility prefix.
Otherwise, the last component of the package name is returned as prefix.
Usage example(s):
Array logFacility => 'STX:Array'
Array class logFacility => 'STX:Array'
Class new logFacility => '__NoProject__:nil'
Behavior new logFacility => '???'
Expecco::Browser logFacility => 'expecco:Browser'
Workflow::Executor logFacility => 'workflow:Executor'
Array package
Array class package
Class new package
Behavior new package
Expecco::Browser package
Workflow::Executor package
|
-
methodsForWhich: aFilter
-
return a collection of methods (both class and inst) for which aFilter returns true
-
methodsWithAnyResource: aResourceSymbolCollection
-
ApplicationModel methodsWithAnyResource:#(fontSpec)
-
packageDirectory
-
return the packageDirectory of this classes package.
That is usually the directory where my source is, and where package specific additional
files (bitmaps, resources etc.) are found.
For standalone apps, nil might be returned if the package's folder is not part
of the deployed package.
Usage example(s):
self packageDirectory
stx_libbasic3 packageDirectory
Array packageDirectory
|
-
resources
-
return the class's resources -
that's a ResourcePack containing national language strings
-
rootsOfTheWorld
-
return a collection of classes which have a nil superclass
Usage example(s):
-
unassignedExtensions
-
return a collection of methods which have not been assigned to any
any package, or empty if there are none.
Usage example(s):
SchemeBoolean unassignedExtensions
|
-
wasAutoloaded
-
return true, if this class came into the system via an
autoload; false otherwise.
This is not an attribute of the class, but instead remembered in
Autoload. The interface here is for your convenience.
-
whichClassDefinesClassVar: aVariableName
-
return the class which defines the class variable named aVariableName.
Usage example(s):
StandardSystemView whichClassDefinesClassVar:'ErrorSignal'
StandardSystemView whichClassDefinesClassVar:'Foo'
|
-
whichClassDefinesPrivateClass: aClassName
-
return the class which defines a private class.
Usage example(s):
Trait whichClassDefinesPrivateClass:'ClassAttributes'
Class whichClassDefinesPrivateClass:'ClassAttributes'
|
renaming
-
makePrivateIn: newOwner
-
make a private class of newOwner from the receiver;
the receiver must be a public class.
Returns the new private class.
-
makePublic
-
make a public class from the receiver.
The receiver must be a private class.
Returns the new public class.
-
makePublicIn: newNameSpace
-
make a public class from the receiver.
The receiver must be a private class.
Returns the new public class.
-
renameTo: newName
-
change the name of the class. This does not write a change record.
** This is an obsolete interface - do not use it (it may vanish in future versions) **
signature checking
-
classinstSizeFromSignature: aSignature
-
for checking class compatibility: return some number based on
the classinstSize from a signature key (not always the real classinstsize).
Usage example(s):
Class classinstSizeFromSignature:16r100. 2
Class classinstSizeFromSignature:16r180. 3
|
-
instNameKeyFromSignature: aSignature
-
for checking class compatibility: return a number based on the
names and order of the instance variables from a signature key.
Usage example(s):
Point instNameKeyFromSignature:Point signature.
Association instNameKeyFromSignature:Association signature.
|
-
instSizeFromSignature: aSignature
-
for checking class compatibility: return the some number based on
the instSize from a signature key (not always the real instSize).
Usage example(s):
Class instSizeFromSignature:Point signature.
Class instSizeFromSignature:Association signature.
Class instSizeFromSignature:Dictionary signature.
Class instSizeFromSignature:16r100.
|
-
instTypeFromSignature: aSignature
-
for checking class compatibility: return some number based on
the instType (i.e. variableBytes/Pointers etc.) from a signature key.
Usage example(s):
Class instTypeFromSignature:Object signature.
Class instTypeFromSignature:Array signature.
Class instTypeFromSignature:String signature.
Class instTypeFromSignature:OrderedCollection signature.
|
-
signature
-
return a signature number - this number is useful for a quick
check for changed classes, and is done in the binary-object loader,
and the dynamic class loader.
Do NOT change the algorithm here - others may depend on it.
Also, the algorithm may change - so never interpret the returned value
(if at all, use the access #XXXFromSignature: methods)
Usage example(s):
Array signature
ByteArray signature
View signature
|
source management
-
binaryRevision
-
return the revision-ID from which the class was stc-compiled;
nil if it's an autoloaded or filedIn class.
If a classes binary is up-to-date w.r.t. the source repository,
the returned string is the same as the one returned by #revision.
Usage example(s):
Object binaryRevision
Object class binaryRevision
|
-
binaryRevisionString
-
return the revision-ID from which the class was stc-compiled;
nil if it's an autoloaded or filedIn class.
If a classes binary is up-to-date w.r.t. the source repository,
the returned string is the same as the one returned by #revision.
Usage example(s):
Object binaryRevisionString
Object class binaryRevisionString
|
-
currentSourceStream
-
return an open stream on the current source of the receiver
-
findVersionMethod
-
return my revision method. Either this is the sourceCodeManager-specific versionMethod,
or the fallBack (for backward compatibility)
Usage example(s):
Smalltalk allClassesDo:[:cls |
Transcript show:cls name; show:' -> '; showCR:cls findVersionMethod
].
Number findVersionMethod
FileDirectory findVersionMethod
Metaclass findVersionMethod
Class findVersionMethod
|
-
findVersionMethodOfManager: aSourceCodemanagerOrNil
-
return my revision method. Either this is the sourceCodeManager-specific versionMethod,
or the fallBack (for backward compatibility)
-
lastCheckinTime
-
returns nil, if the info cannot be extracted (for whatever reason)
Usage example(s):
-
localSourceStreamFor: sourceFilename
-
return an open stream on a local sourcefile, nil if that is not available
-
nameOfOldVersionMethod
-
this is now more or less obsolete, as multiple sourceCodeManagers might use
different version_XXX methods. Currently, we keep this for backward compatibility.
As classes are checked in, using the new source code manager, these methods will
be removed and replaced by version_XXX methods (one per manager).
-
nameOfVersionMethod
-
this is now more or less obsolete, as multiple sourceCodeManagers might use
different version_XXX methods. Keep this for backward compatibility.
As classes are checked in using the new source code manager, these methods will
be removed and replaced by version_XXX methods (one per manager).
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
packageSourceCodeInfo
-
return the sourceCodeInfo, which defines the module and the subdirectory
in which the receiver class was built.
This info is extracted from the package id (which is added to stc-compiled classes).
This method is to be obsoleted soon, since the same info is now found
in the versionString.
The info returned consists of a dictionary
filled with (at least) values at: #module, #directory and #library.
If no such info is present in the class, nil is returned.
(this happens with autoloaded and filed-in classes)
Auotloaded classes set their package from the revisionInfo, if present.
By convention, this info is encoded in the classes package
string (which is given as argument to stc) as the last word in parentheses.
The info consists of 1 to 3 subcomponents, separated by colons.
The first defines the classes module (i.e. some application identifier),
the second defines the subdirectory within that module, the third
defines the name of the class library.
If left blank, the module info defaults to 'stx',
the directory info defaults to library name.
The library name may not be left blank.
(this is done for backward compatibility,)
For example:
'....(libbasic)' -> module: stx directory: libbasic library: libbasic
'....(stx:libbasic)' -> module: stx directory: libbasic library: libbasic
'....(stx:foo:libbfoo)' -> module: stx directory: foo library: libfoo
'....(aeg:libIECInterface)' -> module: aeg directory: libIECInterface library:libIECInterface
'....(stx:goodies/persistency:libdbase)' -> module: stx directory: goodies/persistency library:libdbase
The way how the sourceCodeManager uses this to find the source location
depends on the scheme used. For CVS, the module is taken as the -d arg,
while the directory is prepended to the file name.
Other schemes may do things differently - these are not yet specified.
Caveat:
Encoding this info in the package string seems somewhat kludgy.
Usage example(s):
Object packageSourceCodeInfo
View packageSourceCodeInfo
Model packageSourceCodeInfo
BinaryObjectStorage packageSourceCodeInfo
MemoryMonitor packageSourceCodeInfo
ClockView packageSourceCodeInfo
|
-
projectDirectory
-
return my package's/project's directory - that's where the sources, binaries, classLib,
resources etc. are typically found.
Usage example(s):
Object projectDirectory
View projectDirectory
ApplicationModel projectDirectory
|
-
resourceDirectory
-
return the directory where my resource file is supposed to live.
Here, take the package and assume that a directory named 'resources' exists
in my package directory.
Return nil, if no such directory exists.
Usage example(s):
Object resourceDirectory
View resourceDirectory
ApplicationModel resourceDirectory
|
-
resourcePackName
-
return the name which is used as the fileNameBase of my resource file.
Notice, that this will undergo the same name translation process as
done with class-source file names. (see ResourcePack).
The default here is the classes name - this can be redefined in classes
which want to use another classes resources (NewLauncher -> Launcher).
-
resourcePackage
-
return the package from where my resources are loaded.
By default, that is the classes package.
-
revision
-
return the revision-ID of the class which corresponds to the
scm-version-id of the source to which this class is equivalent.
The class's default source code manager is asked here.
Initially, this is the same as #binaryRevision; however, once changes have
been checked into a source repository, the binary continues to remain based upon
the old revision, while logically, the class has the new (checked-in) revision.
To check if a source corresponds to a compiled binary, compare this
ID with the one returned by #binaryRevision.
Usage example(s):
Object revision
Expecco::ReportParameterEditorForProjects revision
Expecco::ReportParameterEditorForProjects sourceCodeManager
|
-
revisionDate
-
return the revision-Date of the class as date or nil.
This is extracted from the version string.
Usage example(s):
Usage example(s):
verify readability:
Smalltalk allClassesDo:[:cls | (cls revisionDate)]
Smalltalk allClasses
select:[:cls |
(cls revisionDate isNil)
and:[cls isLoaded
and:[cls isNameSpace not]]
]
Smalltalk allClasses
select:[:cls | cls isLoaded and:[cls isNameSpace not]]
thenCollect:[:cls | cls -> cls revisionDate]
|
Usage example(s):
classes stable for more than 10 years:
(Smalltalk allClasses
select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]])
select:[:cls | cls revisionDate < (Timestamp now - (TimeDuration years:10))]
|
Usage example(s):
classes changed within the last 2 days:
(Smalltalk allClasses
select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]])
select:[:cls | cls revisionDate > (Timestamp now - 2 days)]
|
-
revisionDateString
-
return the revision-Date of the class as a string.
This is extracted from the version string.
Usage example(s):
Object revisionDateString
|
-
revisionInfo
-
return an object filled with revision info.
This extracts the relevant info from the revisionString.
For private classes, the revisionInfo of the owning class is returned.
The revisionInfo contains all or a subset of:
binaryRevision - the revision upon which the binary of this class is based
revision - the revision upon which the class is based logically
(different, if a changed class was checked in, but not yet recompiled)
user - the user who checked in the logical revision
date - the date when the logical revision was checked in (as string)
time - the time when the logical revision was checked in (as string)
fileName - the classes source file name
repositoryPath - the classes source container
Usage example(s):
Object revisionString
Object revisionInfo
Image revisionInfo
Method::MethodWhoInfo revisionInfo
|
-
revisionInfoOfManager: aSourceCodemanagerOrNil
-
return an object filled with revision info for a given scm manager (or the default manager, if nil)
This extracts the relevant info from the revisionString.
The revisionInfo contains all or a subset of:
binaryRevision - the revision upon which the binary of this class is based
revision - the revision upon which the class is based logically
(different, if a changed class was checked in, but not yet recompiled)
user - the user who checked in the logical revision
date - the date when the logical revision was checked in
time - the time when the logical revision was checked in
fileName - the classes source file name
repositoryPath - the classes source container
-
revisionOfManager: aSourceCodemanagerOrNil
-
return the revision-ID of the class which corresponds to the
scm-version-id of the source to which this class is equivalent.
The passed in source code manager (or the default manager, if nil) is asked here.
Initially, this is the same as #binaryRevision; however, once changes have
been checked into a source repository, the binary continues to remain based upon
the old revision, while logically, the class has the new (checked-in) revision.
To check if a source corresponds to a compiled binary, compare this
ID with the one returned by #binaryRevision.
-
revisionString
-
return my revision string; that one is extracted from the
classes #version method. Either this is a method returning that string,
or it's a comment-only method and the comment defines the version.
If the receiver is unloaded, or the source is not accessible,
or no such method exists, then nil is returned.
Usage example(s):
Smalltalk allClassesDo:[:cls |
Transcript show:cls name; show:' -> '; showCR:cls revisionString
].
Number revision
Number revisionString
FileDirectory revisionString
Metaclass revisionString
|
-
revisionStringOfManager: aSourceCodeManagerOrNil
-
return my revision string; that one is extracted from the
classes #version method. Either this is a method returning that string,
or it's a comment-only method and the comment defines the version.
If the receiver is unloaded, or the source is not accessible,
or no such method exists, then nil is returned.
-
revisionTimestamp
-
return the revision-Date of the class as timestamp or nil.
This is extracted from the version string.
Usage example(s):
Usage example(s):
verify readability:
Smalltalk allClassesDo:[:cls | (cls revisionTimestamp)]
Smalltalk allClasses
select:[:cls |
(cls revisionTimestamp isNil)
and:[cls isLoaded
and:[cls isNameSpace not]]
]
Smalltalk allClasses
select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]]
thenCollect:[:cls | cls -> cls revisionTimestamp]
|
Usage example(s):
classes changed within the last 2 hours:
(Smalltalk allClasses
select:[:cls | cls isLoaded and:[cls isPrivate not and:[cls isNameSpace not]]])
select:[:cls | cls revisionTimestamp > (Timestamp now - 2 hours)]
|
-
setBinaryRevision: aString
-
set the revision-ID.
This should normally not be done in the running system, as the source-manager
will need this to validate sourcefiles being correct for a given binary
(and optionally: extracting the required sourcefile from the rcs source)
-
setPackageFromRevision
-
set my package from the info found in the revisionString if present.
This is used to set some useful packageInfo after autoloading
(otherwise, autoloaded classes/methods would go into your current
package - which is probably not a good idea)
Usage example(s):
MemoryMonitor autoload.
MemoryMonitor setPackageFromRevision
|
-
sourceFileSuffix
-
Answers a default suffix for source files, i.e.
'st' for Smalltalk, 'js' for JavaScript or 'rb' for Ruby', etc.
-
sourceStream
-
return an open stream on my sourcefile, nil if that is not available
-
sourceStreamFor: sourceFilename
-
return an open stream on a sourcefile, nil if that is not available
Usage example(s):
Object sourceStream
Clock sourceStream
Autoload sourceStream
self sourceStreamFor:'Class.st'
Object sourceStreamFor:'Object.st'
|
-
updateVersionMethodFor: newRevisionString
-
helper for the checkin procedure.
Update my #version method, to now return newRevisionString.
-
validateSourceStream: aStream
-
check if aStream really contains my source.
This is done by checking the version method's return value
against the version string as contained in the version method.
This helps to detect mangled source code.
-
versionMethodTemplateForSourceCodeManager: aSourceCodeManager
-
traits
-
addTrait: aTrait
-
-
applyChangesOfNewTraitCompositionReplacing: oldComposition
-
-
hasTraitComposition
-
Array hasTraitComposition
-
importTraits: aTraitOrTraitsCollection
-
-
overloadedTraitMethods
-
Array overloadedTraitMethods
-
overloadedTraitMethods: aDictionary
-
Array overloadedTraitMethods
-
removeTrait: aTrait
-
-
setTraitComposition: newTraitComposition
-
self applyChangesOfNewTraitCompositionReplacing: oldComposition.
-
traitComposition
-
Array traitComposition
-
traitComposition: aTraitComposition
-
ArrayWithSequenceNumberValidation
ClassAttributes
SimulatedClassPool
|