SwapFile Class Reference

SwapFile class for backing up the SwapManager. More...

Inherits Simba::Support::BinaryFile.

List of all members.

Public Member Functions

virtual void Clear ()
 Erase contents of the current file, setting the size to 0.
virtual void Close ()
 Closes this file.
virtual void Delete ()
 Closes and deletes this file.
virtual simba_int64 GetPosition ()
 Gets current file position.
virtual simba_int64 Read (void *io_buffer, simba_int64 in_size)
virtual bool ReOpen (FileOpenMode in_openmode)
 Re-open wrapped file handle with new mode.
virtual simba_int64 Seek (simba_int64 in_position, SeekDirection in_direction)
 Navigate to the certain position within file.
 SwapFile (const simba_wstring &in_directory)
 Constructor.
 SwapFile ()
 Constructor.
virtual simba_int64 Write (const void *in_buffer, simba_int64 in_size)
 Write text from buffer to the file.
virtual ~SwapFile ()
 Destructor. The physical file is deleted on destruction of this object.

Static Public Member Functions

static void SetSwapFileLimit (simba_uint64 in_maximumSwapDiskSize)
 Set the limit on the total size of all swap files on disk.

Detailed Description

SwapFile class for backing up the SwapManager.


Constructor & Destructor Documentation

SwapFile (  ) 

Constructor.

Creates the SwapFile in the current working directory.

Exceptions:
ErrorException if there was an error generating the swap file name.
SwapFile ( const simba_wstring in_directory  ) 

Constructor.

Parameters:
in_directory The directory to create the SwapFile in.
Exceptions:
ErrorException if there was an error generating the swap file name.
virtual ~SwapFile (  )  [virtual]

Destructor. The physical file is deleted on destruction of this object.


Member Function Documentation

virtual void Clear (  )  [virtual]

Erase contents of the current file, setting the size to 0.

Exceptions:
ErrorException if there was an error clearing the file.

Reimplemented from BinaryFile.

virtual void Close (  )  [virtual]

Closes this file.

Reimplemented from BinaryFile.

virtual void Delete (  )  [virtual]

Closes and deletes this file.

Reimplemented from BinaryFile.

virtual simba_int64 GetPosition (  )  [virtual]

Gets current file position.

Returns:
Absolute position from the beginning of the file. Returns -1 on error.

Reimplemented from BinaryFile.

virtual simba_int64 Read ( void *  io_buffer,
simba_int64  in_size 
) [virtual]

Read from the file into buffer.

Parameters:
io_buffer Buffer to read into.
in_size Size of the provided buffer.
Returns:
Number of bytes read.

Reimplemented from BinaryFile.

virtual bool ReOpen ( FileOpenMode  in_openmode  )  [virtual]

Re-open wrapped file handle with new mode.

Parameters:
in_openmode Open mode as defined in OPENMODE enum.
Returns:
true on success; false otherwise.

Reimplemented from BinaryFile.

virtual simba_int64 Seek ( simba_int64  in_position,
SeekDirection  in_direction 
) [virtual]

Navigate to the certain position within file.

Parameters:
in_position Offset from the current position.
in_direction Direction.
Returns:
Absolute position from the beginning of the file. Returns -1 on error.

Reimplemented from BinaryFile.

static void SetSwapFileLimit ( simba_uint64  in_maximumSwapDiskSize  )  [static]

Set the limit on the total size of all swap files on disk.

Parameters:
in_maximumSwapDiskSize Swap disk size limit (0 means no limit; default).
virtual simba_int64 Write ( const void *  in_buffer,
simba_int64  in_size 
) [virtual]

Write text from buffer to the file.

Parameters:
in_buffer Buffer containing text to write.
in_size Size of the provided buffer.
Returns:
Number of bytes written.

Reimplemented from BinaryFile.


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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba