- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FileListTransferCBInterface Class Reference

Used by FileListTransfer plugin as a callback for when we get a file. You get the last file when fileIndex==setCount. More...

`#include <FileListTransferCBInterface.h>`

List of all members.

## Public Member Functions
virtual bool | OnFile (OnFileStruct *onFileStruct)=0
virtual void | OnFileProgress (OnFileStruct *onFileStruct, unsigned int partCount, unsigned int partTotal, unsigned int partLength, char *firstDataChunk)
virtual bool | Update (void)
virtual bool | OnDownloadComplete (void)
virtual void | OnDereference (void)

## Detailed Description

Used by FileListTransfer plugin as a callback for when we get a file. You get the last file when fileIndex==setCount.

See also:
  FileListTransfer

## Member Function Documentation

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 | ( | OnFileStruct * | onFileStruct,
|  | unsigned int | partCount,
|  | unsigned int | partTotal,
|  | unsigned int | partLength,
|  | char * | firstDataChunk |
| ) |  |  | `[inline, virtual]`

Got part of a big file. You can get these notifications by calling RakPeer::SetSplitMessageProgressInterval Otherwise you will only get complete files.

Parameters:

  `[in]` | onFileStruct | General information about this file, such as the filename and the first partLength bytes. You do NOT need to save this data yourself. The complete file will arrive normally.
  `[in]` | partCount | The zero based index into partTotal. The percentage complete done of this file is 100 * (partCount+1)/partTotal
  `[in]` | partTotal | The total number of parts this file was split into. Each part will be roughly the MTU size, minus the UDP header and RakNet headers
  `[in]` | partLength | How many bytes long firstDataChunk is
  `[in]` | firstDataChunk | The first partLength of the final file. If you store identifying information about the file in the first partLength bytes, you can read them while the download is taking place. If this hasn't arrived yet, firstDataChunk will be 0

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.

virtual bool FileListTransferCBInterface::OnDownloadComplete | ( | void |  | ) | `[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 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.

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

- C:/RakNet/Source/FileListTransferCBInterface.h