FnBind

Data for function bindings.

Only the locations of the first 3 fields (retn, iden, and params) should be relied on. Every other field should always be written/read by using its identifier.

Members

Variables

aliases
string[] aliases;

Optional: A list of identifiers to be aliases of the function.

attr
string attr;

Optional: Function attributes. pure will be removed from dynamic bindings.

ext
string ext;

Specifies which extern linkage to use. | Support status | Input | Generated code | |-------------------|-----------------|-------------------------| | Fully supported | C | extern(C) | | Mostly supported | C++ | extern(C++) | | Mostly supported | C++. "name" | extern(C++, "name") | | Mostly supported | C++. "a", "b" | extern(C++, "a", "b") | | Not yet supported | Objective-C | extern(Objective-C) |

iden
string iden;

The identifier of the function in the library you are binding. Use this when binding a constructor, ~this when binding a destructor. Must be non-null.

isStatic
bool isStatic;

Whether or not a member function is static. Should not be true for non-member functions.

memAttr
string memAttr;

Optional: Member function attributes.

params
string params;

Comma-separated named function parameters. Constructors can have no parameters. Constructors with all-default parameters will not currently work!

pfix
string pfix;

Optional: Anything to be placed immediately before the public version of the function, like deprecated, etc.

pubIden
string pubIden;

Optional: If populated, iden will be private, and a public alias with the name pubIden will be created.

retn
string retn;

Return type. Passing const char* instead of 'const(char)* to a member function will erroneously cause the function to be const. You should use attrib for this instead. Must be void for constructors and destructors. Must be non-null, except where it is ignored.

Examples

FnBbind one = {q{void}, q{someCppFn}, q{int si, uint ui}, ext: `C++`}; //OK
FnBbind two = {q{void}, q{someCppFn}, q{uint ui, int si}, `C++`}; //`ext` was not specified by identifier; might break in the future!

Never place whitespace around strings provided to FnBind, as it may cause incorrect binding generation.

Meta