cxx icon indicating copy to clipboard operation
cxx copied to clipboard

Are inner items supported?

Open Xaeroxe opened this issue 4 years ago • 5 comments

Consider the following C++ code (taken from libwebm)

class BlockEntry {
  BlockEntry(const BlockEntry&);
  BlockEntry& operator=(const BlockEntry&);

 protected:
  BlockEntry(Cluster*, long index);

 public:
  virtual ~BlockEntry();

  // ...
  enum Kind { kBlockEOS, kBlockSimple, kBlockGroup };
  virtual Kind GetKind() const = 0;
  // ...
};

It's not clear to me how you're supposed to create a cxx::bridge for the type BlockEntry::Kind. Trying to treat the class as a namespace doesn't work, and the documentation doesn't show any demonstration of how this should be handled.

Xaeroxe avatar Apr 11 '22 17:04 Xaeroxe

On a similar note, how should one go about binding a static function from a class? i.e.

struct Colour {
  // ...
  static bool Parse(IMkvReader* reader, long long element_start,
                    long long element_size, Colour** colour);
  // ...
}

Xaeroxe avatar Apr 11 '22 18:04 Xaeroxe

At least for the static function I just created outside functions to call the inner static methods on the cpp side. Not ideal, but works.

hntd187 avatar May 22 '22 16:05 hntd187