Bloc serialization features to store/unstore BlElements.
To install Bloc-Serialization on your Pharo image you can just execute the following script:
Metacellonewbaseline:'BlocSerialization';
repository:'github://OpenSmock/Bloc-Serialization:main/src';
load.Use this method to serialize any BlElement into a String.
blElement :=BlElementnew.
string := blElement serialize.Use same method to serialize a list of BlElement into a String.
oc :=OrderedCollectionnew.
oc add:BlElementnew.
oc add:BlElementnew.
oc add:BlElementnew.
string := oc serialize.Use this method to materialize any serialized String into a BlElement. Of course, you need to know that the string is a serialized BlElement.
blElement := string materializeAsBlElement.Use this method to materialize any serialized String into a BlElement collection. Of course, you need to know that the string is a serialized Collection.
oc := string materializeAsBlElement.Tips : you can quickly copy a BlElement using BlElement>>serializeThenMaterialize.
element :=BlElementnew.
copy := element serializeThenMaterialize.Serialization or Materialization process return some exceptions in case of problems :
BlocSerializerError
BlocSerializationErrorBlocMaterializationError
Stash and STON can be used as serialization backends.
The project architecture is flexible enough to accommodate the addition of more serialization backends if required.
This project is licensed under the MIT License - see the LICENSE file for details.