| IGLib 1.7.2 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | List of all members
IG.Lib.ISerializer Interface Reference

Interface for helper classes that perform serialization/deserialization of objects. More...

Inheritance diagram for IG.Lib.ISerializer:
[legend]

## Public Member Functions
void | Serialize< T > (T serializedObject, Stream serializationStream)
| Serializes the specified object and outputs it to a stream. More...
void | Serialize< T > (T serializedObject, string filePath)
| Serializes the specified object and outputs it to a file. If the specified file exists then it is overwritten. More...
void | Serialize< T > (T serializedObject, string filePath, bool append)
| Serializes the specified object and outputs it to a file. More...
string | Serialize< T > (T obj)
| Serializes the specified object to a string and returns it. More...
T | Deserialize< T > (Stream deserializationStream)
| Deserializes an object from the specified stream containing JSON representation of the object. Deserialized object is instantiated and returned. More...
T | DeserializeString< T > (string strSerialized)
| Deserializes an object from JSON - serialized string representation and returns it. More...
T | DeserializeFile< T > (string filePath)
| Deserializes an object from JSON - serialized file and returns it. More...

## Detailed Description

Interface for helper classes that perform serialization/deserialization of objects.

## Member Function Documentation

void IG.Lib.ISerializer.Serialize< T > | ( | T | serializedObject,
|  | Stream | serializationStream
| ) |  |

Serializes the specified object and outputs it to a stream.

Template Parameters

  T | Type of the object to be serialized.

Parameters

  serializedObject | Object to be serialized.
  serializationStream | Stream on which the serialized object is output.

Implemented in IG.Lib.SerializerJsonBase, IG.Lib.SerializerBase, and IG.Lib.SerializerJson.

void IG.Lib.ISerializer.Serialize< T > | ( | T | serializedObject,
|  | string | filePath
| ) |  |

Serializes the specified object and outputs it to a file. If the specified file exists then it is overwritten.

Template Parameters

  T | Type of the object to be serialized.

Parameters

  serializedObject | Object to be serialized.
  filePath | Path to the file that serialized object is written to.

Implemented in IG.Lib.SerializerBase.

void IG.Lib.ISerializer.Serialize< T > | ( | T | serializedObject,
|  | string | filePath,
|  | bool | append
| ) |  |

Serializes the specified object and outputs it to a file.

Template Parameters

  T | Type of the object to be serialized.

Parameters

  serializedObject | Object to be serialized.
  filePath | Path to the file that serialized object is written to.
  append | If true then the generated contents is appended to a file.

Implemented in IG.Lib.SerializerBase.

string IG.Lib.ISerializer.Serialize< T > | ( | T | obj | ) |

Serializes the specified object to a string and returns it.

Template Parameters

  T | Type of the object to be serialized.

Parameters

  obj | Objejct to be serialized.

Returns
  String containing the serialized object.

Implemented in IG.Lib.SerializerBase.

T IG.Lib.ISerializer.Deserialize< T > | ( | Stream | deserializationStream | ) |

Deserializes an object from the specified stream containing JSON representation of the object. Deserialized object is instantiated and returned.

Template Parameters

  T | Type of the deserialized object.

Parameters

  deserializationStream | Stream from which object is deserialized.

Returns
  Object that is deserialized from the stream.

Implemented in IG.Lib.SerializerJsonBase, and IG.Lib.SerializerBase.

T IG.Lib.ISerializer.DeserializeString< T > | ( | string | strSerialized | ) |

Deserializes an object from JSON - serialized string representation and returns it.

Template Parameters

  T | Type of the deserialized object.

Parameters

  strSerialized | String containing the serialized object.

Returns
  Object instantiated form the serialiyed representation.

Implemented in IG.Lib.SerializerBase.

T IG.Lib.ISerializer.DeserializeFile< T > | ( | string | filePath | ) |

Deserializes an object from JSON - serialized file and returns it.

Template Parameters

  T | Type of the deserialized object.

Parameters

  filePath | Path to thefile. File must contain the appropriately serialized object of the correct type.

Returns
  Object deserialized from the file.

Implemented in IG.Lib.SerializerBase.

The documentation for this interface was generated from the following file:

- igbase/data/serialization/SerializerBase.cs