IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Lib.ISerializer Interface Reference

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

+ Inheritance diagram for IG.Lib.ISerializer:

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...
 
Deserialize< T > (Stream deserializationStream)
 Deserializes an object from the specified stream containing JSON representation of the object. Deserialized object is instantiated and returned. More...
 
DeserializeString< T > (string strSerialized)
 Deserializes an object from JSON - serialized string representation and returns it. More...
 
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 > ( serializedObject,
Stream  serializationStream 
)

Serializes the specified object and outputs it to a stream.

Template Parameters
TType of the object to be serialized.
Parameters
serializedObjectObject to be serialized.
serializationStreamStream 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 > ( serializedObject,
string  filePath 
)

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

Template Parameters
TType of the object to be serialized.
Parameters
serializedObjectObject to be serialized.
filePathPath to the file that serialized object is written to.

Implemented in IG.Lib.SerializerBase.

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

Serializes the specified object and outputs it to a file.

Template Parameters
TType of the object to be serialized.
Parameters
serializedObjectObject to be serialized.
filePathPath to the file that serialized object is written to.
appendIf true then the generated contents is appended to a file.

Implemented in IG.Lib.SerializerBase.

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

Serializes the specified object to a string and returns it.

Template Parameters
TType of the object to be serialized.
Parameters
objObjejct 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
TType of the deserialized object.
Parameters
deserializationStreamStream 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
TType of the deserialized object.
Parameters
strSerializedString 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
TType of the deserialized object.
Parameters
filePathPath 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: