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

Abstract interface for file-like objects. More...

Inheritance diagram for eVision.ESerializer:

Public Member Functions

None Close (self)
 Closes the eVision.ESerializer object and frees any underlying ressource it could have reserved.
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.

Static Public Member Functions

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

Abstract interface for file-like objects.

Remarks:

The eVision.ESerializer object manages operations of reading from and writing to an archive (a file on the system hard disk, for instance). eVision.ESerializer objects cannot be instantiated directly. To create an eVision.ESerializer object, one of the following static factory methods has to be used:

Note
An eVision.ESerializer object can not be used in the same time for reading and writing. So, eVision.ESerializer.CreateFileWriter creates an eVision.ESerializer object that should be used with Save methods and eVision.ESerializer.CreateFileReader creates an eVision.ESerializer object that should be used with Load methods.

License(s): None

Member Function Documentation

◆ Close()

None eVision.ESerializer.Close ( self)

Closes the eVision.ESerializer object and frees any underlying ressource it could have reserved.

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 in eVision.ECallbackSerializer, eVision.EFileSerializer, and eVision.EMemorySerializer.

◆ Closed()

bool eVision.ESerializer.Closed ( self)

Indicates if the eVision.ESerializer is closed or not.

Reimplemented in eVision.ECallbackSerializer, eVision.EFileSerializer, and eVision.EMemorySerializer.

◆ CreateFileReader()

eVision.ESerializer | None eVision.ESerializer.CreateFileReader ( str filePath)
static

Returns an eVision.ESerializer object suitable for reading from a file.

Remarks:

If the call does not succeed, it returns NULL. Please check the eVision error code to get further informations.

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

Deprecated

Instantiate directly eVision.EFileSerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Parameters
filePathFull path and name specification of the file to be used to create the eVision.ESerializer object.

◆ CreateFileWriter() [1/2]

eVision.ESerializer | None eVision.ESerializer.CreateFileWriter ( str filePath)
static

Returns an eVision.ESerializer object suitable for opening a file and writing into it.

Remarks:

The eVision.ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when 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.

If the call does not succeed, it returns NULL. Please check the eVision error code to get further information.

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

Deprecated

Instantiate directly eVision.EFileSerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Parameters
filePathFull path and name specification of the file to be used to create the eVision.ESerializer object.

◆ CreateFileWriter() [2/2]

eVision.ESerializer | None eVision.ESerializer.CreateFileWriter ( str filePath,
eVision.ESerializerFileWriterMode mode )
static

Returns an eVision.ESerializer object suitable for opening a file and writing into it.

Remarks:

The eVision.ESerializerFileWriterMode parameter is an enumerated type that allows to control what happens when 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.

If the call does not succeed, it returns NULL. Please check the eVision error code to get further information.

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

Deprecated

Instantiate directly eVision.EFileSerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Parameters
filePathFull path and name specification of the file to be used to create the eVision.ESerializer object.
modeCreation mode of the storage file, as defined by eVision.ESerializerFileWriterMode (by default, Overwrite).

◆ CreateMemoryReader() [1/2]

eVision.ESerializer | None eVision.ESerializer.CreateMemoryReader ( ctypes.c_void_p buffer,
int size )
static

Returns an eVision.ESerializer object suitable for reading from a buffer.

Remarks:

It is up to users to delete the eVision.ESerializer object when they have done using it in Load calls.

Deprecated

Instantiate directly a eVision.EMemorySerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Parameters
bufferAddress of an external buffer to be used by the memory serializer.

Those bytes will be copied into the returned object's internal buffer.

Parameters
sizeSize of the external buffer.

◆ CreateMemoryReader() [2/2]

eVision.ESerializer | None eVision.ESerializer.CreateMemoryReader ( list[int] bytes)
static

Returns an eVision.ESerializer object suitable for reading from a buffer.

Remarks:

It is up to users to delete the eVision.ESerializer object when they have done using it in Load calls.

Deprecated

Instantiate directly a eVision.EMemorySerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Parameters
bytesA vector containing a list of bytes to read.

Those bytes will be copied into the returned object's internal buffer.

◆ CreateMemoryWriter() [1/3]

eVision.ESerializer | None eVision.ESerializer.CreateMemoryWriter ( )
static

Returns an eVision.ESerializer object suitable for serializing into a buffer.

Remarks:

If a buffer is not provided, a buffer will be automatically created and managed internally by the object.

Please note that, in this case, if you didn't provide a size, the buffer will be automatically resized as needed.

It is up to users to delete the eVision.ESerializer object when they have done using it in Save calls.

The returned serializer underlying type is eVision.EMemorySerializer, for more information, see the class documentation.

Deprecated

Instantiate directly eVision.EMemorySerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

◆ CreateMemoryWriter() [2/3]

eVision.ESerializer | None eVision.ESerializer.CreateMemoryWriter ( ctypes.c_void_p buffer,
int size )
static

Returns an eVision.ESerializer object suitable for serializing into a buffer.

Remarks:

If a buffer is not provided, a buffer will be automatically created and managed internally by the object.

Please note that, in this case, if you didn't provide a size, the buffer will be automatically resized as needed.

It is up to users to delete the eVision.ESerializer object when they have done using it in Save calls.

The returned serializer underlying type is eVision.EMemorySerializer, for more information, see the class documentation.

Deprecated

Instantiate directly eVision.EMemorySerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Parameters
bufferAddress of the buffer to be used by the memory serializer.
sizeSize of the buffer to be used by the memory serializer.

◆ CreateMemoryWriter() [3/3]

eVision.ESerializer | None eVision.ESerializer.CreateMemoryWriter ( int initialBufferSize)
static

Returns an eVision.ESerializer object suitable for serializing into a buffer.

Remarks:

If a buffer is not provided, a buffer will be automatically created and managed internally by the object.

Please note that, in this case, if you didn't provide a size, the buffer will be automatically resized as needed.

It is up to users to delete the eVision.ESerializer object when they have done using it in Save calls.

The returned serializer underlying type is eVision.EMemorySerializer, for more information, see the class documentation.

Deprecated

Instantiate directly eVision.EMemorySerializer using its constructor instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Parameters
initialBufferSizeSize to which allocate the buffer used internally by the memory serializer.

◆ Mode()

eVision.ESerializerMode eVision.ESerializer.Mode ( self)

The current mode of the serializer.

Reimplemented in eVision.ECallbackSerializer, eVision.EFileSerializer, and eVision.EMemorySerializer.

◆ Writing()

bool eVision.ESerializer.Writing ( self)

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

Deprecated

Use eVision.ESerializer.Mode instead.

Deprecated in version 25.2. Scheduled to be removed in version 27.6.

Reimplemented in eVision.EFileSerializer.