|
KiCad PCB EDA Suite
|
RAII wrapper for memory-mapped file I/O. More...
#include <io.h>
Public Member Functions | |
| MAPPED_FILE (const wxString &aFileName) | |
| ~MAPPED_FILE () | |
| MAPPED_FILE (const MAPPED_FILE &)=delete | |
| MAPPED_FILE & | operator= (const MAPPED_FILE &)=delete |
| const uint8_t * | Data () const |
| size_t | Size () const |
Private Member Functions | |
| void | readIntoBuffer (const wxString &aFileName) |
Private Attributes | |
| const uint8_t * | m_data = nullptr |
| size_t | m_size = 0 |
| bool | m_isMapped = false |
| std::vector< uint8_t > | m_fallbackBuffer |
RAII wrapper for memory-mapped file I/O.
Uses mmap on POSIX and MapViewOfFile on Windows. Falls back to reading the entire file into a heap buffer if memory mapping is unavailable.
|
explicit |
Definition at line 163 of file unix/io.cpp.
References m_data, m_isMapped, m_size, and readIntoBuffer().
Referenced by MAPPED_FILE(), and operator=().
| KIPLATFORM::IO::MAPPED_FILE::~MAPPED_FILE | ( | ) |
Definition at line 205 of file unix/io.cpp.
References m_data, m_isMapped, and m_size.
|
delete |
References MAPPED_FILE().
|
inline |
|
delete |
References MAPPED_FILE().
|
private |
Definition at line 29 of file common/io.cpp.
References m_data, m_fallbackBuffer, and m_size.
Referenced by MAPPED_FILE().
|
inline |
|
private |
Definition at line 56 of file io.h.
Referenced by Data(), MAPPED_FILE(), readIntoBuffer(), and ~MAPPED_FILE().
|
private |
Definition at line 66 of file io.h.
Referenced by readIntoBuffer().
|
private |
Definition at line 63 of file io.h.
Referenced by MAPPED_FILE(), and ~MAPPED_FILE().
|
private |
Definition at line 57 of file io.h.
Referenced by MAPPED_FILE(), readIntoBuffer(), Size(), and ~MAPPED_FILE().