|
Class: HistoryLine (private in HistoryManager
This class is only visible from within
HistoryManager.
Object
|
+--HistoryManager::HistoryLine
- Package:
- stx:libbasic3
- Category:
- System-Changes-History
- Owner:
- HistoryManager
The class HistoryLine is part of the HistoryManagerProjcet.
HistoryLine knows how to compose and parse comment lines which are
used to keep track of changes. These historyLines are added at the end of
a methods source code and to the special history classmethod.
HistoryLine and HistoryManager where generously provided by AEG for inclusion into the
ST/X class delivery.
copyrightCOPYRIGHT (c) 1995 by AEG Industry Automation
COPYRIGHT (c) 1995 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.
converting
-
convertStringToDate: aString
-
kludge
Usage example(s):
HistoryLine convertStringToDate:'18.10.1995' -> 18-10-1995
HistoryLine convertStringToDate:'18.10.95' -> 18-10-1995
HistoryLine convertStringToDate:'18.10.01' -> 18-10-2001
HistoryLine convertStringToDate:'2001-03-01' -> 01-03-2001
|
-
convertStringToTime: aString
-
was a kludge by Robert; not needed, as Time can convert both hh:mm and hh:mm:ss
Usage example(s):
HistoryLine convertStringToTime:'18:23:15'
HistoryLine convertStringToTime:'18:23:15 foo'
HistoryLine convertStringToTime:'18:23'
HistoryLine convertStringToTime:'18:23 foo'
|
filtering
-
filterHistoryLines: aCollectionOfHistoryLines
-
check the collection against multiple occurrence of the same user,
and remove all but the youngest (per user).
-
modificationLimit
-
Answer the number of seconds between creation and
modifcation of a method within which the modification
line won't be added.
-
timeIsShortFrom: histLine1 to: histLine2
-
initialization
-
initialize
-
setup class variables
Usage example(s):
instance creation
-
fromString: aString
-
parses the argument, aString;
create & return a new Instance with the values
Usage example(s):
HistoryLine fromString: 'Modified: 01.12.93 / 18:32:30 / M.Noell'
HistoryLine fromString: 'Created: 01.12.93 / 18:32:30 / M.Noell'
|
-
fromString: aString at: position
-
parses the String and creates a new Instance with the values.
The positionvalue is normally used to remove the HistoryLines from the sourceCode.
Claus: return nil, if the string is not a valid historyString.
Usage example(s):
HistoryLine fromString: 'Modified: 21.12.93 / 18:32:30 / R.Sailer'
HistoryLine fromString: 'Created: 21.12.1993 / 18:32:30 / Felicitas Gabriele Felger'
HistoryLine fromString: 'Deleted: 21.12.93 / 18:32:30 / Astrid Weisseise'
HistoryLine fromString: 'Deleted: foo bar / 21.12.93 / 18:32:30 / Astrid Weisseise'
|
-
new
-
get a new history line.
Preinitialize it as a modified-Line for the current user
-
newCreated
-
public - get a new created-Line for the current user
Usage example(s):
private
-
type: type what: what
-
private - for integration purposes only
accessing
-
date
-
return the date
-
date: something
-
set the date
-
firstPositionInSourceCode
-
return firstPositionInSourceCode
-
firstPositionInSourceCode: anInteger
-
set firstPositionInSourceCode
-
isForAddition
-
-
isForCommented
-
-
isForCreation
-
-
isForDeletion
-
-
isForFormatted
-
-
isForModification
-
-
isForVariableRenamed
-
-
lastPositionInSourceCode
-
return lastPositionInSourceCode
-
lastPositionInSourceCode: anInteger
-
set lastPositionInSourceCode
-
time
-
return the time
-
time: something
-
set the time
-
type
-
return the type
-
type: something
-
set the type
-
user
-
return the user
-
user: something
-
set the user
-
what
-
return the what-changed info
-
what: someStringOrSelector
-
set the what-changed info
comparing
-
= aHistoryLine
-
compares two instances of HistoryLine
Usage example(s):
| h1 h2 |
h1 := HistoryLine for: OperatingSystem getLoginName.
h2 := h1 copy.
h1 = h2 ifTrue:[
InfoBox new title: 'users are equal'; show.
].
h2 := HistoryLine for: OperatingSystem getLoginName.
h1 = h2 ifFalse:[
InfoBox new title: 'users are not equal'; show.
].
|
-
hash
-
return a hash key for the receiver
Usage example(s):
Check hashCode
|h1 h2 oc |
h1 := HistoryLine new hash.
h2 := HistoryLine new hash.
oc := OrderedCollection new.
oc add: h1.
oc add: h2.
^oc
using hash in a set:
| h1 h2 aSet oc |
h1 := HistoryLine new hash.
h2 := HistoryLine new hash.
oc := OrderedCollection new.
oc add: h1.
oc add: h2.
aSet := oc asSet.
^aSet
|
-
sameDate: aHistoryLine
-
returns true if aUserName = user in preperation for a SortedCollection of HistoryLines
Usage example(s):
| h1 h2 |
h1 := HistoryLine new.
h2 := h1 copy.
(h1 sameDate: h2) ifTrue:[
InfoBox new title: 'Dates are equal'; show.
].
h2 := HistoryLine for: 'R.Sailer'.
h2 date: (Date day: 12 month: 6 year:1981).
(h1 sameDate: h2) ifFalse:[
InfoBox new title: 'users are not equal'; show.
].
|
-
sameType: aHistoryLine
-
returns true if the Type = type in preperation for a SortedCollection of HistoryLines
Usage example(s):
| h1 h2 |
h1 := HistoryLine new.
h2 := h1 copy.
(h1 sameType: h2) ifTrue:[
InfoBox new title: 'Types are equal'; show.
].
h2 := HistoryLine createdBy: 'R.Sailer'.
(h1 sameType: h2) ifFalse:[
InfoBox new title: 'Types are not equal'; show.
].
|
-
sameUser: aHistoryLine
-
returns true if aUserName = user in preperation for a SortedCollection of HistoryLines
Usage example(s):
| h1 h2 |
h1 := HistoryLine new.
h2 := h1 copy.
(h1 sameUser: h2) ifTrue:[
InfoBox new title: 'users are equal'; show.
].
h2 := HistoryLine for: 'R.Sailer'.
(h1 sameUser: h2) ifFalse:[
InfoBox new title: 'users are not equal'; show.
].
|
-
sameWhat: aHistoryLine
-
returns true if the what = type in preperation for a SortedCollection of HistoryLines
printing & storing
-
printOn: aStream
-
return a printed representation of a HistoryLine as a string
Usage example(s):
self new printOn:Transcript
|
queries
-
isCreated
-
returns true if the bodytext is CreatedString
Usage example(s):
HistoryLine new isModified
(HistoryLine for: 'R.Sailer') isCreated
(HistoryLine createdBy: 'R.Sailer') isCreated
HistoryLine deleted isModified
(HistoryLine deletedBy: 'M.Noell') isModified
|
-
isDeleted
-
returns true if the bodytext is DeletedString
Usage example(s):
HistoryLine deleted isDeleted
HistoryLine new isDeleted
|
-
isKindOfModified
-
returns true if the bodytext is ModifiedString
-
isModified
-
returns true if the bodytext is ModifiedString
Usage example(s):
HistoryLine new isModified
(HistoryLine for: 'R.Sailer') isModified
HistoryLine deleted isModified
(HistoryLine deletedBy: 'M.Noell') isModified
|
HistoryLine initialize.
HistoryLine new.
HistoryLine for: 'R.Sailer'. for integration purposes ONLY
HistoryLine deleted.
|