EncryptedRandomAccessFile Class Reference

Container class implementing the IFile interface and providing block encryption capabilities to an underlying random access file. More...

Inherits Simba::Support::IFile.

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.
 EncryptedRandomAccessFile (AutoPtr< IFile > io_file=AutoPtr< IFile >(NULL))
 Constructor.
virtual simba_int64 Extend (simba_int64 in_size)
 Extend the file to a size of precisely length bytes. If the file previously was shorter, it is extended, and the content of extended part is not defined. If the file was same size, it is not extended and the actual size of the file is returned. If the file previously was larger than this size, return -1.
virtual void Flush ()
 Flush data to file.
virtual const simba_wstringGetName () const
 Gets the file name.
virtual simba_int64 GetPosition ()
 Gets current file position.
virtual bool IsOpen ()
 Determines if file is currently open.
virtual simba_int64 Read (void *io_buffer, simba_int64 in_size)
 Read from the file into buffer.
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.
virtual simba_int64 Write (const void *in_buffer, simba_int64 in_size)
 Write text from buffer to the file.
virtual ~EncryptedRandomAccessFile ()
 Destructor. The physical file is deleted on destruction of this object.

Detailed Description

Container class implementing the IFile interface and providing block encryption capabilities to an underlying random access file.


Constructor & Destructor Documentation

EncryptedRandomAccessFile ( AutoPtr< IFile io_file = AutoPtrIFile >(NULL)  ) 

Constructor.

The class "steals" the given file object to have exclusive use of it. The given auto pointer is NULL after the call. The file must be opened before hand.

Parameters:
in_file Random access file object to use. (OWN)
Exceptions:
ErrorException if there was an error generating the swap file name.
virtual ~EncryptedRandomAccessFile (  )  [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.

Implements IFile.

virtual void Close (  )  [virtual]

Closes this file.

Implements IFile.

virtual simba_int64 Extend ( simba_int64  in_size  )  [virtual]

Extend the file to a size of precisely length bytes. If the file previously was shorter, it is extended, and the content of extended part is not defined. If the file was same size, it is not extended and the actual size of the file is returned. If the file previously was larger than this size, return -1.

Parameters:
in_size New size in bytes.
Returns:
The new size of the file or -1.

Implements IFile.

virtual void Flush (  )  [virtual]

Flush data to file.

Implements IFile.

virtual const simba_wstring& GetName (  )  const [virtual]

Gets the file name.

Returns:
The name of the binary file.

Implements IFile.

virtual simba_int64 GetPosition (  )  [virtual]

Gets current file position.

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

Implements IFile.

virtual bool IsOpen (  )  [virtual]

Determines if file is currently open.

Returns:
true if file is open; false otherwise.

Implements IFile.

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. (NOT OWN)
in_size Size of the provided buffer.
Returns:
Number of bytes read.

Implements IFile.

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.

Implements IFile.

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.

Implements IFile.

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.

Implements IFile.


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

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