eVision .NET API
Loading...
Searching...
No Matches
eVision.EFileSerializer Class Reference

A type of ESerializer suitable for serialization and deserialization to and from memory buffers. More...

Inheritance diagram for eVision.EFileSerializer:
Collaboration diagram for eVision.EFileSerializer:

Public Member Functions

 EFileSerializer (eVision.ESerializerMode mode, string filePath, eVision.ESerializerFileWriterMode fileWriterMode)
 Creates an instance of EFileSerializer either in read mode or write mode.
 EFileSerializer (eVision.ESerializerMode mode, string filePath)
 Creates an instance of EFileSerializer either in read mode or write mode.
override void Close ()
 Closes the EFileSerializer.EFileSerializer object and frees the file handle created during the construction of this object.

Properties

override eVision.ESerializerMode Mode [get]
 The current mode of the serializer.
override bool Closed [get]
 Indicates if the ESerializer is closed or not.
override bool Writing [get]
 Returns true if the ESerializer object has been created for writing and false otherwise.
Properties inherited from eVision.ESerializer
eVision.ESerializerMode Mode [get]
 The current mode of the serializer.
bool Closed [get]
 Indicates if the ESerializer is closed or not.
virtual bool Writing [get]
 Returns true if the ESerializer object has been created for writing and false otherwise.

Additional Inherited Members

Static Public Member Functions inherited from eVision.ESerializer
static eVision.ESerializer CreateFileWriter (string filePath, eVision.ESerializerFileWriterMode mode)
 Returns an ESerializer object suitable for opening a file and writing into it.
static eVision.ESerializer CreateFileWriter (string filePath)
 Returns an ESerializer object suitable for opening a file and writing into it.
static eVision.ESerializer CreateFileReader (string filePath)
 Returns an ESerializer object suitable for reading from a file.
static eVision.ESerializer CreateMemoryWriter ()
 Returns an ESerializer object suitable for serializing into a buffer.
static eVision.ESerializer CreateMemoryWriter (uint initialBufferSize)
 Returns an ESerializer object suitable for serializing into a buffer.
static eVision.ESerializer CreateMemoryWriter (IntPtr buffer, uint size)
 Returns an ESerializer object suitable for serializing into a buffer.
static eVision.ESerializer CreateMemoryReader (IntPtr buffer, uint size)
 Returns an ESerializer object suitable for reading from a buffer.
static eVision.ESerializer CreateMemoryReader (byte[] bytes)
 Returns an ESerializer object suitable for reading from a buffer.
static eVision.ESerializer CreateCallbackWriter (IntPtr isEOS, IntPtr setCurrentPos, IntPtr getCurrentPos, IntPtr serializeMemory, IntPtr close, IntPtr cookie)
static eVision.ESerializer CreateCallbackReader (IntPtr isEOS, IntPtr setCurrentPos, IntPtr getCurrentPos, IntPtr serializeMemory, IntPtr close, IntPtr cookie)

Detailed Description

A type of ESerializer suitable for serialization and deserialization to and from memory buffers.

Call to EFileSerializer.Close is mandatory after usage to ensure the file handle used by this class is properly released.

License(s): None

Constructor & Destructor Documentation

◆ EFileSerializer() [1/2]

eVision.EFileSerializer.EFileSerializer ( eVision.ESerializerMode mode,
string filePath,
eVision.ESerializerFileWriterMode fileWriterMode )

Creates an instance of EFileSerializer either in read mode or write mode.

Parameters
modeThe serializer mode, read or write.
filePathFull path and name specification of the file to be used to create the EFileSerializer object.
fileWriterModeUsed only in write mode. Creation mode of the storage file, as defined by ESerializerFileWriterMode (defaults to overwrite mode).

The ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when the EFileSerializer is used in write mode and the file already exists:

  • If mode is Create, the call will not succeed if the file already exists.
  • If mode is Overwrite, the existing file will be overwritten.
  • If mode is Append, the new data will be appended to the existing file content.

◆ EFileSerializer() [2/2]

eVision.EFileSerializer.EFileSerializer ( eVision.ESerializerMode mode,
string filePath )

Creates an instance of EFileSerializer either in read mode or write mode.

Parameters
modeThe serializer mode, read or write.
filePathFull path and name specification of the file to be used to create the EFileSerializer object.

The ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when the EFileSerializer is used in write mode and the file already exists:

  • If mode is Create, the call will not succeed if the file already exists.
  • If mode is Overwrite, the existing file will be overwritten.
  • If mode is Append, the new data will be appended to the existing file content.

Member Function Documentation

◆ Close()

override void eVision.EFileSerializer.Close ( )
virtual

Closes the EFileSerializer.EFileSerializer object and frees the file handle created during the construction of this object.

This method is always called implicitly during the destruction of the object. It is still recommended to call it explicitly in programming languages other than C++ to ensure the underlying ressources are correctly released.

This method never throws exceptions.

Reimplemented from eVision.ESerializer.

Property Documentation

◆ Closed

override bool eVision.EFileSerializer.Closed
get

Indicates if the ESerializer is closed or not.

◆ Mode

override eVision.ESerializerMode eVision.EFileSerializer.Mode
get

The current mode of the serializer.

◆ Writing

override bool eVision.EFileSerializer.Writing
get

Returns true if the ESerializer object has been created for writing and false otherwise.