ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
file_operations::filesystemt Class Reference

Files bundled into the binary, overlaid on the real filesystem. More...

#include <filesystem.h>

Public Member Functions

void add_bundled (const std::string &path, const char *data, size_t size)
 Registers static file contents; see file_data::bundled().
std::optional< file_data > read (const std::string &path) const
 Contents of path, or nothing if it is neither bundled nor a readable file.
bool exists (const std::string &path) const
bool readable (const std::string &path) const
 Whether the contents of path can actually be obtained.
size_t bundled_count () const noexcept
 How many bundled files are registered.
std::vector< std::string > list (const std::string &prefix) const
 Every bundled path below prefix, at any depth.
const std::string & materialize (const std::string &prefix, const std::string &format)
 Writes every bundled file below prefix into a fresh temporary directory named after format, and returns that directory.

Static Public Member Functions

static filesystemt & get ()

Detailed Description

Files bundled into the binary, overlaid on the real filesystem.

Files scripts/flail.py bundles are registered under ESBMC_VFS_ROOT. read() checks the registry first and falls back to disk, so callers cannot tell which layer answered. materialize() writes a subtree out for consumers that cannot read ESBMC's memory: a forked python3 or solc.

Member Function Documentation

◆ add_bundled()

void filesystemt::add_bundled ( const std::string & path,
const char * data,
size_t size )

Registers static file contents; see file_data::bundled().

path must not already be registered.

◆ bundled_count()

size_t filesystemt::bundled_count ( ) const
noexcept

How many bundled files are registered.

Only ever grows, so a change means new registrations arrived.

◆ exists()

bool filesystemt::exists ( const std::string & path) const

◆ get()

filesystemt & filesystemt::get ( )
static

◆ list()

std::vector< std::string > filesystemt::list ( const std::string & prefix) const

Every bundled path below prefix, at any depth.

◆ materialize()

const std::string & filesystemt::materialize ( const std::string & prefix,
const std::string & format )

Writes every bundled file below prefix into a fresh temporary directory named after format, and returns that directory.

Cached per prefix, so a subtree is written at most once per run. The directory is removed when ESBMC exits.

◆ read()

std::optional< file_data > filesystemt::read ( const std::string & path) const

Contents of path, or nothing if it is neither bundled nor a readable file.

◆ readable()

bool filesystemt::readable ( const std::string & path) const

Whether the contents of path can actually be obtained.

Unlike exists(), a file that refuses to open does not qualify.


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