# FileListTransferCBInterface Class Reference

Used by FileListTransfer plugin as a callback for when we get a file. More...

`#include <FileListTransferCBInterface.h>`

List of all members.

## Public Member Functions

virtual bool | OnFile (OnFileStruct *onFileStruct)=0
| Got a file.
virtual void | OnFileProgress (FileProgressStruct *fps)=0
| Got part of a big file internally in RakNet.
virtual bool | Update (void)
| Called while the handler is active by FileListTransfer.
virtual bool | OnDownloadComplete (DownloadCompleteStruct *dcs)
| Called when the download is completed.
virtual void | OnDereference (void)
| This function is called when this instance is about to be dereferenced by the FileListTransfer plugin.

## Detailed Description

Used by FileListTransfer plugin as a callback for when we get a file.

You get the last file when fileIndex==numberOfFilesInThisSet

See also:
  FileListTransfer

## Member Function Documentation

virtual void FileListTransferCBInterface::OnDereference | ( | void |  | ) | `[inline, virtual]`

This function is called when this instance is about to be dereferenced by the FileListTransfer plugin.

Update will no longer be called. It will will be deleted automatically if true was passed to FileListTransfer::SetupReceive::deleteHandler Otherwise it is up to you to delete it yourself.

virtual bool FileListTransferCBInterface::OnDownloadComplete | ( | DownloadCompleteStruct * | dcs | ) | `[inline, virtual]`

Called when the download is completed.

If you are finished with this class, return false. At that point OnDereference will be called and the class will no longer be maintained by the FileListTransfer plugin. Otherwise return true, and Update will continue to be called.

virtual bool FileListTransferCBInterface::OnFile | ( | OnFileStruct * | onFileStruct | ) | `[pure virtual]`

Got a file.

This structure is only valid for the duration of this function call.

Returns:
  Return true to have RakNet delete the memory allocated to hold this file for this function call.

virtual void FileListTransferCBInterface::OnFileProgress | ( | FileProgressStruct * | fps | ) | `[pure virtual]`

Got part of a big file internally in RakNet.

This is called in one of two circumstances: Either the transport layer is returning ID_PROGRESS_NOTIFICATION, or you got a block via IncrementalReadInterface If the transport layer is returning ID_PROGRESS_NOTIFICATION (see RakPeer::SetSplitMessageProgressInterval()) then FileProgressStruct::iriDataChunk will be 0. If this is a block via IncrementalReadInterface, then iriDataChunk will point to the block just downloaded. If not using IncrementalReadInterface, then you only care about partCount and partTotal to tell how far the download has progressed. YOu can use firstDataChunk to read the first part of the file if desired. The file is usable when you get the OnFile callback. If using IncrementalReadInterface and you let RakNet buffer the files in memory (default), then it is the same as above. The file is usable when you get the OnFile callback. If using IncrementalReadInterface and you do not let RakNet buffer the files in memory, then set allocateIrIDataChunkAutomatically to false. Write the file to disk whenever you get OnFileProgress and iriDataChunk is not 0, and ignore OnFile.

virtual bool FileListTransferCBInterface::Update | ( | void |  | ) | `[inline, virtual]`

Called while the handler is active by FileListTransfer.

Return false when you are done with the class. At that point OnDereference will be called and the class will no longer be maintained by the FileListTransfer plugin.

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

- d:/RakNet-3.x/Source/FileListTransferCBInterface.h