mcpp index

compat.mio

#include

mio — cross-platform header-only memory-mapped file IO

#include <mio/mmap.hpp>
mcpp add compat.mio@2023.3.3

Usage

From this repository's own test project — built and run by CI, not written for the website.

// Behavioral test — compat.mio actually maps a file.
//
// The test writes its own file into the working directory, maps it, reads
// through the mapping and then writes through a second mapping. Nothing here
// depends on the runner's filesystem layout beyond "can create a file", which
// is true on all three CI platforms.
#include <mio/mmap.hpp>

#include <cstdio>
#include <fstream>
#include <string>
#include <system_error>

int main() {
    const std::string path = "mcpp_mio_test.bin";
    const std::string payload = "mcpp-index mio round trip";

    {
        std::ofstream out(path, std::ios::binary | std::ios::trunc);
        out.write(payload.data(), static_cast<std::streamsize>(payload.size()));
    }

// …

tests/examples/mio/tests/mmap.cpp · project tests/examples/mio

Build

targets
mio (lib)
language
c++23
C standard
c11
import std
no
include dirs
*/include

Sources (1)

  • mcpp_generated/mio_anchor.c

Generated files

  • mcpp_generated/mio_anchor.c

Versions

VersionPlatforms Mirrorssha256
2023.3.3 latest LinuxWindowsmacOS CN GLOBAL 86248113bb2f…