//------------------------------------------------------------------------------ // getSlotByName() -- Returns a pointer to the slot named 'slotname'. //------------------------------------------------------------------------------ Object* Object::getSlotByName(const char* const slotname) { Object* obj = 0; int slotindex = slotName2Index(slotname); if (slotindex > 0) obj = getSlotByIndex(slotindex); return obj; }
//------------------------------------------------------------------------------ // setSlotByName() -- set the value of slot 'slotname' to 'obj' Returns // true if the slot and object were processed; returns // false if there was an error. //------------------------------------------------------------------------------ bool Object::setSlotByName(const char* const slotname, Object* const obj) { bool ok = false; if (obj == nullptr) return ok; int slotindex = slotName2Index(slotname); if (slotindex > 0) ok = setSlotByIndex(slotindex,obj); return ok; }