Package: cppbind
IntroductionCppBind is a software development tool that automates language bindings
generation between C++ and other languages. It works by annotating C++
code to indicate parts desired to expose to all supported target
languages. The current version of the tool supports bindings withSwift,Kotlin, andPython, while support for new languages
can be added relatively easily.Manually developing bindings is complex, time-consuming, and
error-prone, especially for large-scale projects requiring frequent
changes. To develop manual bindings, one should be knowledgeable in both
C++ and the target language to implement types serialization from one
language to another, function and method mapping, and more. To overcome
these challenges, we introduce CppBind.CppBind main highlights:Generates binding wrappers for multiple languages (Python, Swift,
and Kotlin);Allows using language-agnostic annotations for all supported
languages;Supports a rich set of C++ features;Provides the ability to add support for other languages;Can be used to generate bindings for third-party C++ libraries.FeaturesCppBind generates bindings for C++ types and entities like classes,
methods, global functions, enums, nested structures, templates, etc. The
list of the main features of CppBind is following:FunctionsGlobal functionsOverloaded functionsOptional argumentsDefault argumentsReturn value's lifetime and ownership managementControlling function arguments' lifetimeOOPClasses and structsNested typesC++ classes/structs as target language interfacesEnumerationsInheritanceSingle inheritanceMultiple inheritance through the target language interfacesObject type preservationStatic methodsMethod overloadingConverting getters/setters to target language propertiesOperator overloadingOverloading subscript operatorTemplatesTemplate classesTemplate methods and functionsConverting getters/setters with template parameters to target language propertiesException handlingStandard library types (std::shared_ptr, std::vector, std::map, etc.)Custom type conversionsIntelligent code completionUsageCppBind instructions are controlled using annotations. There are two
prominent use cases for annotating C++ source files: either you are the
source code owner, or it's from a third-party/standard library. CppBind
annotations are specified directly in the source files in the first
case. In the second case, separate config files can be used. The second
use case works well for binding third-party C++ libraries.To configure a project with self-owned files, you can read our
"Hello User"tutorial.To configure a project with third-party/standard library files, you
can read our "Array"tutorial.Above-described usages can also be mixed: annotations for self-owned
files are written inside those files, while third-party/standard library
files are annotated via separate config files.InstallationThere are some required steps to install and use CppBind. The
installation steps are describedhere.LicenseCppBind is provided under the MIT license that can be found in theLICENSEfile.
By using, distributing, or contributing to this project, you agree to
the terms and conditions of this license.How to contribute to CppBind?If you like CppBind and would like to contribute to this open-source
project, please check theContribution
guide.