Skip to content

Commit

Permalink
docs: Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsergio committed Apr 9, 2024
1 parent d45f65d commit 9b42390
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

![Build Status](https://github.com/iamsergio/dartagnan/actions/workflows/build.yml/badge.svg)

Dartagnan is a POC of C++ Dart bindings generator.
Unlike other generators, Dartagnan preserves OOP semantics when crossing language barrier.
A Dart class can inherit from a C++ class, override virtual methods and still get dynamic dispatch working.
Dartagnan is a POC of C++ Dart bindings generator.<br>
Unlike other generators, Dartagnan preserves OOP semantics when crossing language barrier.<br>
A Dart class can inherit from a C++ class, override virtual methods and still get dynamic dispatch working.<br>
In other words, whether the base class is Dart or C++ is irrelevant from the user's prespective, as inheritance
still works as supposed to.

Expand All @@ -17,26 +17,27 @@ class Animal {
public:
// non-virtual! for example purposes
void eat() {
std::cout << "eat from C++";
std::cout << "eat from C++\n";
openMouth();
closeMouth();
}

virtual void openMouth() {
std::cout << "openMouth from C++";
std::cout << "openMouth from C++\n";
}

virtual void closeMouth() {
std::cout << "closeMouth from C++";
std::cout << "closeMouth from C++\n";
}
};
```

```dart
class MyDartAlligator extends MyBindings.Animal {
class MyDartAlligator extends MyBindings.Animal
{
@override
void openMouth() {
print("openMouth from Dart");
print("openMouth from Dart\n");
}
}
Expand Down

0 comments on commit 9b42390

Please sign in to comment.