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

A type of eVision.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

None __init__ (self, eVision.ESerializerMode mode, str filePath, eVision.ESerializerFileWriterMode fileWriterMode)
 Creates an instance of eVision.EFileSerializer either in read mode or write mode.
None __init__ (self, eVision.ESerializerMode mode, str filePath)
 Creates an instance of eVision.EFileSerializer either in read mode or write mode.
None Close (self)
 Closes the eVision.EFileSerializer.__init__ object and frees the file handle created during the construction of this object.
eVision.ESerializerMode Mode (self)
 The current mode of the serializer.
bool Closed (self)
 Indicates if the eVision.ESerializer is closed or not.
bool Writing (self)
 Returns true if the eVision.ESerializer object has been created for writing and false otherwise.

Additional Inherited Members

Static Public Member Functions inherited from eVision.ESerializer
eVision.ESerializer|None CreateFileWriter (str filePath, eVision.ESerializerFileWriterMode mode)
 Returns an eVision.ESerializer object suitable for opening a file and writing into it.
eVision.ESerializer|None CreateFileWriter (str filePath)
 Returns an eVision.ESerializer object suitable for opening a file and writing into it.
eVision.ESerializer|None CreateFileReader (str filePath)
 Returns an eVision.ESerializer object suitable for reading from a file.
eVision.ESerializer|None CreateMemoryWriter ()
 Returns an eVision.ESerializer object suitable for serializing into a buffer.
eVision.ESerializer|None CreateMemoryWriter (int initialBufferSize)
 Returns an eVision.ESerializer object suitable for serializing into a buffer.
eVision.ESerializer|None CreateMemoryWriter (ctypes.c_void_p buffer, int size)
 Returns an eVision.ESerializer object suitable for serializing into a buffer.
eVision.ESerializer|None CreateMemoryReader (ctypes.c_void_p buffer, int size)
 Returns an eVision.ESerializer object suitable for reading from a buffer.
eVision.ESerializer|None CreateMemoryReader (list[int] bytes)
 Returns an eVision.ESerializer object suitable for reading from a buffer.

Detailed Description

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

Remarks:

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

License(s): None

Constructor & Destructor Documentation

◆ __init__() [1/2]

None eVision.EFileSerializer.__init__ ( self,
eVision.ESerializerMode mode,
str filePath,
eVision.ESerializerFileWriterMode fileWriterMode )

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

Remarks:

The eVision.ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when the eVision.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.
Parameters
modeThe serializer mode, read or write.
filePathFull path and name specification of the file to be used to create the eVision.EFileSerializer object.
fileWriterModeUsed only in write mode. Creation mode of the storage file, as defined by eVision.ESerializerFileWriterMode (defaults to overwrite mode).

◆ __init__() [2/2]

None eVision.EFileSerializer.__init__ ( self,
eVision.ESerializerMode mode,
str filePath )

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

Remarks:

The eVision.ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when the eVision.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.
Parameters
modeThe serializer mode, read or write.
filePathFull path and name specification of the file to be used to create the eVision.EFileSerializer object.

Member Function Documentation

◆ Close()

None eVision.EFileSerializer.Close ( self)

Closes the eVision.EFileSerializer.__init__ 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.

◆ Closed()

bool eVision.EFileSerializer.Closed ( self)

Indicates if the eVision.ESerializer is closed or not.

Reimplemented from eVision.ESerializer.

◆ Mode()

eVision.ESerializerMode eVision.EFileSerializer.Mode ( self)

The current mode of the serializer.

Reimplemented from eVision.ESerializer.

◆ Writing()

bool eVision.EFileSerializer.Writing ( self)

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

Reimplemented from eVision.ESerializer.