IncrementalReadInterface.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #ifndef __INCREMENTAL_READ_INTERFACE_H
  11. #define __INCREMENTAL_READ_INTERFACE_H
  12. #include "FileListNodeContext.h"
  13. #include "Export.h"
  14. namespace RakNet
  15. {
  16. class RAK_DLL_EXPORT IncrementalReadInterface
  17. {
  18. public:
  19. IncrementalReadInterface() {}
  20. virtual ~IncrementalReadInterface() {}
  21. /// Read part of a file into \a destination
  22. /// Return the number of bytes written. Return 0 when file is done.
  23. /// \param[in] filename Filename to read
  24. /// \param[in] startReadBytes What offset from the start of the file to read from
  25. /// \param[in] numBytesToRead How many bytes to read. This is also how many bytes have been allocated to preallocatedDestination
  26. /// \param[out] preallocatedDestination Write your data here
  27. /// \return The number of bytes read, or 0 if none
  28. virtual unsigned int GetFilePart( const char *filename, unsigned int startReadBytes, unsigned int numBytesToRead, void *preallocatedDestination, FileListNodeContext context);
  29. };
  30. } // namespace RakNet
  31. #endif
粤ICP备19079148号