tjfontaine / node-ffi-generate

Generate ffi bindings from header files
131 stars 22 forks source link

How to set the path of Class #13

Closed yh4922 closed 2 years ago

yh4922 commented 4 years ago

I have a .h file like this

#pragma once 

class  __declspec(dllexport) Person
{
private:
    int age;
public:
    int getAge();
    void setAge(int a);
};

I used this tool to generate it to me like this

var FFI = require('ffi'),
    ArrayType = require('ref-array'),
    Struct = require('ref-struct'),
    ref = require('ref');

var voidPtr = ref.refType(ref.types.void);

exports.CONSTANTS = {
};

exports.libmyLibrary = new FFI.Library('libmyLibrary', {
});

I want to know how to refer to classes and classes that contain a class