// Copyright 2021 The Emscripten Authors. All rights reserved.1// Emscripten is available under two separate licenses, the MIT license and the2// University of Illinois/NCSA Open Source License. Both these licenses can be3// found in the LICENSE file.45// This file defines the modular backend abstract class.67#pragma once89#include "file.h"1011namespace wasmfs {12// A backend (or modular backend) provides a base to extend WasmFS with new13// storage capabilities. Files and directories will be represented in the file14// system structure, but their underlying backing could exist in persistent15// storage, another thread, etc.16class Backend {1718public:19virtual std::shared_ptr<DataFile> createFile(mode_t mode) = 0;20virtual std::shared_ptr<Directory> createDirectory(mode_t mode) = 0;21virtual std::shared_ptr<Symlink> createSymlink(std::string target) = 0;2223virtual ~Backend() = default;24};2526typedef backend_t (*backend_constructor_t)(void*);27} // namespace wasmfs282930