class FileReader


class FileReader : public IReadable { /* full declaration omitted */ };


IReadable implementation wrapping a FILE* pointer created by fopen() and a read buffer.

Declared at: mcap/include/mcap/reader.hpp:75

Inherits from: IReadable

Method Overview

  • public FileReader(std::FILE * file)
  • public uint64_t read(std::byte ** output, uint64_t offset, uint64_t size)
  • public uint64_t size() const

Inherited from IReadable:


FileReader(std::FILE* file)

Declared at: mcap/include/mcap/reader.hpp:77


std::FILE* file

uint64_t read(std::byte** output,
              uint64_t offset,
              uint64_t size)


This method is called by MCAP reader classes when they need to read a portion of the file.

Declared at: mcap/include/mcap/reader.hpp:80


std::byte** output
A pointer to a pointer to the buffer to write to. This method is expected to either maintain an internal buffer, read data into it, and update this pointer to point at the internal buffer, or update this pointer to point directly at the source data if possible. The pointer and data must remain valid and unmodified until the next call to read().
uint64_t offset
The offset in bytes from the beginning of the file to read.
uint64_t size
The number of bytes to read.


uint64_t Number of bytes actually read. This may be less than the requested size if the end of the file is reached. The output pointer must be readable from `output` to `output + size`. If the read fails, this method should return 0.

uint64_t size() const


Returns the size of the file in bytes.

Declared at: mcap/include/mcap/reader.hpp:79


uint64_t The total number of bytes in the MCAP file.