[squeak-dev] [Feedback] What you think about this..
Edgar J. De Cleene
edgardec2001 at yahoo.com.ar
Fri Jan 29 10:16:30 UTC 2010
Copy part as I send to Aida and SqueakRos list
> I attach the needed for read objects in different images.
> File in in order the .cs, the .st and the .obj
> Original comes from MinimalMorphic and could be read in any compatible image .
> Even I have it in Squeak3.11-8917-alpha.image!!!
> And one you have the objects into the target .image, you could do any you wish
> with it
>
> I wonder why all talk about objects and work with ASCII data like .text, htm,
> .xml instead .obj
I using .obj all the time to send info from one .image to another.
Is to wild put the logic in trunk?
Edgar
-------------- next part --------------
'From MinimalMorphic of 8 December 2006 [latest update: #7246] on 27 January 2010 at 10:40:30 am'!
!Object methodsFor: 'objects from disk' stamp: 'edc 9/5/2008 08:57'!
saveOnFileNamed: aString
"Ask the user for a filename and save myself on a
SmartReferenceStream file. Writes out the version and class structure.
The file is fileIn-able. UniClasses will be filed out.
This save objects as .obj"
| aFileName fileStream |
aString isEmpty
ifTrue: [^ Beeper beep].
aFileName := ('my {1}' translated format: {self class name}) asFileName.
"do better?"
aFileName := aString , '.obj'.
fileStream := FileStream newFileNamed: aFileName asFileName.
fileStream fileOutClass: nil andObject: self! !
!Object class methodsFor: '*services-extras' stamp: 'edc 2/14/2008 08:24'!
fileReaderServicesForFile: fullName suffix: suffix
| services |
services _ OrderedCollection new.
(fullName asLowercase endsWith: '.obj')
ifTrue: [ services add: self serviceLoadObject ].
^services! !
!Object class methodsFor: '*services-extras' stamp: 'edc 7/27/2008 08:11'!
readCompressedObject: aFileStream
self readAndInspect: (MultiByteBinaryOrTextStream with: (GZipReadStream on: aFileStream) upToEnd) reset! !
!Object class methodsFor: '*services-extras' stamp: 'edc 10/25/2006 17:45'!
registeredServices
^ {
Service new
label: 'Open saved objects';
shortLabel: 'object';
description: 'load back saved object ';
action: [:stream | self readAndInspect: (FileStream oldFileOrNoneNamed:stream name)];
shortcut: nil;
categories: Service worldServiceCat.} ! !
!Object class methodsFor: '*services-extras' stamp: 'edc 7/27/2008 07:40'!
serviceCompressedObject
"Answer a service for opening a saved Object"
^ (SimpleServiceEntry
provider: Object
label: 'gz saved Object'
selector: #readCompressedObject:
description: 'open a gz Object'
buttonLabel: 'object')
argumentGetter: [:fileList |
fileList readOnlyStream]! !
!Object class methodsFor: '*services-extras' stamp: 'edc 2/14/2008 08:26'!
serviceLoadObject
"Answer a service for opening a saved Object"
^ (SimpleServiceEntry
provider: self
label: 'saved Object'
selector: #readAndInspect:
description: 'open a Object'
buttonLabel: 'object')
argumentGetter: [:fileList | fileList readOnlyStream]! !
!Object class methodsFor: 'objects from disk' stamp: 'edc 6/11/2008 07:37'!
readAndInspect: inputStream
inputStream setConverterForCode.
(inputStream fileInObjectAndCode ) inspect! !
!Utilities class methodsFor: 'identification' stamp: 'edc 10/6/2008 09:58'!
methodsWithInitials: targetInitials inClass: aClass
"Based on a do-it contributed to the Squeak mailing list by G¦Ã¬Âran Hultgen:
Browse methods whose initials (in the time-stamp, as logged to disk) match the given initials.
Print out the complete time-stamp table to the Transcript.
Answer a list of (initials -> count) associations.
CAUTION: It may take several minutes for this to complete."
"Time millisecondsToRun: [Utilities methodsWithInitials: 'bf']"
| methodList methodListClass |
methodList := aClass methodDict select:[:cm|
cm author = targetInitials].
methodListClass := aClass class methodDict select:[:cm| cm author = targetInitials].
^methodList,methodListClass
! !
-------------- next part --------------
'From MinimalMorphic of 8 December 2006 [latest update: #7246] on 27 January 2010 at 10:23:03 am'!
Object subclass: #MiHTMLData
instanceVariableNames: 'title body date color links indexValue css ip'
classVariableNames: ''
poolDictionaries: ''
category: 'NaughtieWiki'!
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/4/2010 16:44'!
body
"Answer the value of body"
^ body! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/4/2010 16:44'!
body: anObject
"Set the value of body"
body := anObject! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/12/2010 09:47'!
color
"Answer the value of color"
^ color! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/12/2010 09:47'!
color: anObject
"Set the value of color"
color := anObject! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/22/2010 07:52'!
css
"Answer the value of css"
^ css ifNil: ['Default' ]! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/19/2010 06:26'!
css: anObject
"Set the value of css"
css := anObject! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/4/2010 16:44'!
date
"Answer the value of date"
^ date! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/4/2010 16:44'!
date: anObject
"Set the value of date"
date := anObject! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/17/2010 08:33'!
indexValue
"Answer the value of indexValue"
^ indexValue! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/17/2010 08:33'!
indexValue: anObject
"Set the value of indexValue"
indexValue := anObject! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/19/2010 11:00'!
ip
"Answer the value of ip"
^ ip ifNil:['localhost']! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/19/2010 10:59'!
ip: anObject
"Set the value of ip"
ip := anObject! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/11/2010 10:26'!
links
^ links ifNil:[String new]! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/12/2010 09:47'!
links: anObject
"Set the value of links"
links := anObject! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/4/2010 16:44'!
title
"Answer the value of title"
^ title! !
!MiHTMLData methodsFor: 'accessing' stamp: 'edc 1/4/2010 16:44'!
title: anObject
"Set the value of title"
title := anObject! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
MiHTMLData class
instanceVariableNames: 'current'!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3857.obj
Type: application/octet-stream
Size: 5801 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100129/944869ae/3857.obj
More information about the Squeak-dev
mailing list
|