Skip to main content

Apache OpenDAL™ C++ Binding

A C++ binding for OpenDAL: access S3, GCS, Azure Blob, HDFS, the local filesystem, and 50+ more services through one API, backed by the Rust core.

New to the model behind the API? Read Concepts first — service, operator, layer, and operation are the same four ideas in every language.

Experimental

This binding is experimental and a work in progress. There is no published package; you must build from source with CMake. The API may change without notice between releases. It is not yet recommended for production use.

Status

Unreleased. Built from source only. Only Clang and AppleClang are currently supported as compilers; MSVC and GCC are not yet tested.

Capabilities

  • Sync API (opendal.hpp) — opendal::Operator with read, write, stat, list, copy, rename, remove, and directory creation.
  • Async API (opendal_async.hpp, opt-in via -DOPENDAL_ENABLE_ASYNC=ON, requires C++20) — opendal::async::Operator exposing the same operations as futures.
  • StreamingReader / ReaderStream for large-object reads without an intermediate copy; Lister / Lister::Iterator for directory traversal.
  • Capability introspectionOperator::Info() returns a Capability struct so you can check at runtime which features a backend supports.
  • Services controlled at build time via the OPENDAL_FEATURES CMake variable (e.g. "opendal/services-s3,opendal/services-memory").

Integration via CMake

include(FetchContent)

FetchContent_Declare(
opendal-cpp
GIT_REPOSITORY https://github.com/apache/opendal.git
GIT_TAG v0.40.0
SOURCE_SUBDIR bindings/cpp
)
FetchContent_MakeAvailable(opendal-cpp)

target_link_libraries(your_target opendal_cpp)

Vendored source

mkdir third_party && cd third_party
git clone https://github.com/apache/opendal.git
cd opendal && git checkout v0.40.0
add_subdirectory(third_party/opendal/bindings/cpp)
target_link_libraries(your_target opendal_cpp)

Prerequisites

  • CMake ≥ 3.22
  • Clang or AppleClang with C++17 support (C++20 required for async)

Next steps

  1. Getting started — a runnable program, then a real backend.