Set sets the value of the property with the given name.
(name string, val *Value)
| 348 | |
| 349 | // Set sets the value of the property with the given name. |
| 350 | func (v *Value) Set(name string, val *Value) { |
| 351 | if !v.isAlive() || !val.belongsTo(v.ctx) { |
| 352 | return |
| 353 | } |
| 354 | var namePtr *C.char |
| 355 | if len(name) > 0 { |
| 356 | namePtr = (*C.char)(unsafe.Pointer(unsafe.StringData(name))) |
| 357 | } |
| 358 | C.SetPropertyByNameLen(v.ctx.ref, v.ref, namePtr, C.size_t(len(name)), val.ref) |
| 359 | } |
| 360 | |
| 361 | // SetIdx sets the value of the property with the given index. |
| 362 | func (v *Value) SetIdx(idx int64, val *Value) { |