Skip to content

Commit

Permalink
Merge pull request #3 from Mobject-Dev-Team/pre-v0.4.0
Browse files Browse the repository at this point in the history
Pre v0.4.0
  • Loading branch information
benhar-dev authored Apr 4, 2024
2 parents 208aefd + 5e59983 commit 7201909
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
17 changes: 10 additions & 7 deletions docs/I_Serializer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Definition

| | |
| ----------- | ----------------- |
| Namespace | mobject-seralizer |
| Library | mobject-seralizer |
| Inheritance | I_Disposable |
| Implements | |
| | |
| ----------- | ------------------------------------------------------------ |
| Namespace | mobject-seralizer |
| Library | mobject-seralizer |
| Inheritance | [I_Disposable](http://disposable.mobject.org/#/I_Disposable) |
| Implements | |

## Remarks

The `I_Serializer` interface is designed to facilitate the serialization of various data types in a structured manner. It extends the `I_Disposable` interface, indicating that instances of `I_Serializer` should be disposed of properly to release resources. The interface provides a wide range of methods to add data of different types to the serialization stream, including primitive types, arrays, and complex objects implementing the `I_Serializable` interface. Additionally, it offers functionality to manage the serialization state, such as starting and ending objects and arrays, and methods to retrieve or reset the serialized data.
The `I_Serializer` interface is designed to facilitate the serialization of various data types in a structured manner. It extends the [I_Disposable](http://disposable.mobject.org/#/I_Disposable) interface, indicating that instances of `I_Serializer` should be disposed of properly to release resources. The interface provides a wide range of methods to add data of different types to the serialization stream, including primitive types, arrays, and complex objects implementing the `I_Serializable` interface. Additionally, it offers functionality to manage the serialization state, such as starting and ending objects and arrays, and methods to retrieve or reset the serialized data.

## Methods

Expand Down Expand Up @@ -61,10 +61,13 @@ The following example demonstrates how to use the `I_Serializer` interface to se
```plaintext
VAR
mySerializer: I_Serializer;
myString : T_MAXSTRING;
result : BOOL;
END_VAR
mySerializer.StartObject();
mySerializer.AddKeyString('Name', 'Example Object');
mySerializer.AddKeyDint('ID', 12345);
mySerializer.EndObject();
result := mySerializer.TryGetSerializedData(ADR(myString), SIZEOF(myString)); // result = TRUE, myString = '{"Name":"Example Object","ID":12345}'
```
Binary file modified mobject-serialization.library
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ END_VAR]]></Declaration>
VAR_INPUT
END_VAR]]></Declaration>
</Method>
<Method Name="GetSeralizedDataLength" Id="{dd25f96d-06dc-4960-8c8c-b867ac96101a}">
<Declaration><![CDATA[METHOD PUBLIC GetSeralizedDataLength : UDINT
<Method Name="GetSerializedDataLength" Id="{dd25f96d-06dc-4960-8c8c-b867ac96101a}">
<Declaration><![CDATA[METHOD PUBLIC GetSerializedDataLength : UDINT
VAR_INPUT
END_VAR
]]></Declaration>
Expand Down

0 comments on commit 7201909

Please sign in to comment.