|
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
- Author:
- Robert Sailer - AEG
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.
HistoryManager
converting
-
convertStringToDate: aString
-
kludge
usage example(s):
HistoryLine convertStringToDate:'18.10.1995'
HistoryLine convertStringToDate:'18.10.95'
HistoryLine convertStringToDate:'18.10.01'
HistoryLine convertStringToDate:'2001-03-01'
|
-
convertStringToTime: aString
-
kludge
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
-
currentUserName
-
return the current users name -
that's either the userInfos-gecos field, or the users login name.
usage example(s):
HistoryLine currentUserName
|
-
type: type what: what
-
private - for integration purposes only
accessing
-
date
-
return the date
-
date: something
-
set the date
-
firstPositionInSourceCode
-
return firstPositionInSourceCode
-
firstPositionInSourceCode: something
-
set firstPositionInSourceCode
-
isForAddition
-
-
isForCommented
-
-
isForCreation
-
-
isForDeletion
-
-
isForFormatted
-
-
isForModification
-
-
isForVariableRenamed
-
-
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
-
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
-
sameType: aHistoryLine
-
returns true if the Type = type in preperation for a SortedCollection of HistoryLines
-
sameUser: aHistoryLine
-
returns true if aUserName = user in preperation for a SortedCollection of HistoryLines
-
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.
|