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 — the shared storage semantics and path and operation concepts every binding expresses through its own native API.

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. Build from source with Clang, AppleClang, or MSVC for the sync API. The async API requires Clang or AppleClang.

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.
  • Streaming — Reader / ReaderStream for large-object reads without an intermediate copy; Lister / Lister::Iterator for directory traversal.
  • Capability introspection — Operator::Info() returns a Capability struct so you can check at runtime which features a backend supports.
  • Services — the default build includes memory. Enable additional services with OPENDAL_FEATURES.

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, AppleClang, or MSVC with C++17 support for the sync API
  • Clang or AppleClang with C++20 support for the async API

Next steps​

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