[Cuis] serialization in Cuis
Edgar J. De Cleene
edgardec2005 at gmail.com
Sat Nov 7 05:31:06 CST 2015
As Juan said, ReferenceStream is your friend
Here I attach a old cs
If you wish , Foo saveOnFileNamed: 'Foo'create a Foo.obj file in your
working directory.
Later you could use readAndInspect: 'Path to your file'
When you have DrgaAndDrop as my forked CuiSantafesino you could exchange
working objects between Squeak,Cuis and Pharo.
And if you said Pharo do not have ReferenceStream , well I made how to for
Pharo 2.0 so is possible.
With this technique I export and import objects big enough for have complete
swiki into a Squeak derivate image, about 14 mb of data
Cheers
Edgar
@morplenauta
On 11/6/15, 3:48 PM, "Juan Vuletich" <juan at jvuletich.org> wrote:
> Hi Nacho,
>
> Oh, yes, I misread. Ok. ReferenceStream and SmartRefStream are your choices.
> Take a look at the class comments, play with the examples. Ask questions.
>
> Cheers,
> Juan Vuletich
>
>
> On 11/6/2015 3:42 PM, Ignacio Sniechowski wrote:
>>
>> Hi Juan,
>>
>> Thanks for your response.
>>
>> I¹m not trying to serialize classes but instances of them.
>>
>> Suppose theres a class called Memo with an ivar ³content²
>>
>> Then I want to be able add to the instances the posibility of storing their
>> data.
>>
>> fileOut is great for classes I use it a lot!
>>
>> But I want a way to preserve data outside the image, so it can be loaded when
>> a new image is used.
>>
>> thanks!
>>
>> Nacho
>>
>>
>>
>>
>>
>>
>> --
>> Ignacio Sniechowski
>>
>> Prosavic SRL
>> Sent with Airmail
>>
>>
>>
>>
>> On November 6, 2015 at 3:13:25 PM, Juan Vuletich (juan at jvuletich.org) wrote:
>>
>>>
>>>
>>> Hi Nacho,
>>>
>>> On 11/1/2015 11:45 PM, nacho wrote:
>>>> > Hi Folks,
>>>> > I'm trying to add support for serializing instances of a class.
>>>> > I'm looking at System-Object Storage
>>>> > And in particular to the class SmartRefStream which seems to add that
>>>> > functionality. However, the class has no comments and no examples.
>>>> > Is there some example which uses this class? a short demo? an example?
>>>> > Thanks in advance!!
>>>> > best
>>>> > Nacho
>>>> >
>>>
>>> Are we browsing the same system? SmartRefStream class comment is 6016
>>> characters here. Superclass ReferenceStream has a class comments of 2875
>>> characters. DataStream and ReferenceStream have class methods that start
>>> with 'example'. Looking for references to these classes also brings
>>> useful examples of usage.
>>>
>>> In any case, the usual way to serialize classes is fileOut. Why doesn't
>>> this work for you? What problem are you trying to solve?
>>>
>>> Cheers,
>>> Juan Vuletich
>>>
>>>
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20151107/b0b7510f/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ObjectEnhEd.2.cs
Type: application/octet-stream
Size: 15734 bytes
Desc: not available
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20151107/b0b7510f/attachment-0004.obj>
More information about the Cuis
mailing list