// Imitate Name::set(const NameLite& nameLite). static void setName(PyObject* name, const NameLite& nameLite) { PyObjectRef ignoreResult1(PyObject_CallMethodObjArgs(name, str.clear, NULL)); for (size_t i = 0; i < nameLite.size(); ++i) { PyObjectRef blob(makeBlob(nameLite.get(i).getValue())); PyObjectRef type(PyLong_FromLong((int)nameLite.get(i).getType())); PyObjectRef otherTypeCode(PyLong_FromLong(nameLite.get(i).getOtherTypeCode())); PyObjectRef ignoreResult3(PyObject_CallMethodObjArgs (name, str.append, blob.obj, type.obj, otherTypeCode.obj, NULL)); } }
void Name::set(const NameLite& nameLite) { clear(); for (size_t i = 0; i < nameLite.size(); ++i) append(Component(nameLite.get(i))); }
// Imitate Name::set(const NameLite& nameLite). static void setName(PyObject* name, const NameLite& nameLite) { PyObjectRef ignoreResult1(PyObject_CallMethodObjArgs(name, str.clear, NULL)); for (size_t i = 0; i < nameLite.size(); ++i) { PyObjectRef blob(makeBlob(nameLite.get(i).getValue())); // Imitate Name::Component::set(const NameLite::Component& componentLite). if (nameLite.get(i).isImplicitSha256Digest()) PyObjectRef ignoreResult2(PyObject_CallMethodObjArgs (name, str.appendImplicitSha256Digest, blob.obj, NULL)); else PyObjectRef ignoreResult3(PyObject_CallMethodObjArgs (name, str.append, blob.obj, NULL)); } }