| 97 | } |
| 98 | |
| 99 | void DynamicQMetaObjectBuilder::addMethod(const char *name, const char *signature, QList<QByteArray> arguments, Local<Value> cb) |
| 100 | { |
| 101 | Nan::HandleScope scope; |
| 102 | |
| 103 | BrigMetaMethod *method = new BrigMetaMethod(); |
| 104 | method->name = strdup(name); |
| 105 | method->signature = strdup(signature); |
| 106 | method->arguments = arguments; |
| 107 | method->handler = new Nan::Callback(cb.As<Function>()); |
| 108 | _methods.append(method); |
| 109 | #if 0 |
| 110 | // Create a new callback |
| 111 | Callback *callback = new Callback(); |
| 112 | callback->signature = strdup(name); |
| 113 | callback->handler = new Nan::Callback(cb.As<Function>()); |
| 114 | _methods.append(callback); |
| 115 | |
| 116 | // Preparing arguments |
| 117 | QList<QByteArray> arguments; |
| 118 | for (auto argName : argumentNames) { |
| 119 | arguments.push_back(argName.toLatin1()); |
| 120 | } |
| 121 | |
| 122 | // Add to method builder |
| 123 | builder->addMethod(signature).setParameterNames(arguments); |
| 124 | printf("Added method handler: %s\n", callback->signature); |
| 125 | #endif |
| 126 | } |
| 127 | |
| 128 | void DynamicQMetaObjectBuilder::addProperty(const char *name, Local<Value> readCallback, Local<Value> writeCallback) |
| 129 | { |
no outgoing calls
no test coverage detected