bool Name::Component::hasPrefix(const uint8_t* prefix, size_t prefixLength) const { NameLite::Component componentLite; get(componentLite); return componentLite.hasPrefix(prefix, prefixLength) != 0; }
uint64_t Name::Component::toNumber() const { NameLite::Component componentLite; get(componentLite); return componentLite.toNumber(); }
uint64_t Name::Component::toNumberWithPrefix(const uint8_t* prefix, size_t prefixLength) const { NameLite::Component componentLite; get(componentLite); uint64_t result; ndn_Error error; if ((error = componentLite.toNumberWithPrefix(prefix, prefixLength, result))) throw runtime_error(ndn_getErrorString(error)); return result; }
uint64_t Name::Component::toNumberWithMarker(uint8_t marker) const { NameLite::Component componentLite; get(componentLite); uint64_t result; ndn_Error error; if ((error = componentLite.toNumberWithMarker(marker, result))) throw runtime_error(ndn_getErrorString(error)); return result; }
// Imitate Name::Component::get(NameLite::Component& componentLite). static void toNameComponentLite(PyObject* nameComponent, NameLite::Component& componentLite) { if (toBoolByMethod(nameComponent, str.isImplicitSha256Digest)) componentLite.setImplicitSha256Digest (toBlobLiteByMethod(nameComponent, str.getValue)); else if (toBoolByMethod(nameComponent, str.isParametersSha256Digest)) componentLite.setParametersSha256Digest (toBlobLiteByMethod(nameComponent, str.getValue)); else componentLite = NameLite::Component (toBlobLiteByMethod(nameComponent, str.getValue), (ndn_NameComponentType)(int)toLongByMethod(nameComponent, str.getType), (int)toLongByMethod(nameComponent, str.getOtherTypeCode)); }
void Name::Component::get(NameLite::Component& componentLite) const { if (type_ == ndn_NameComponentType_IMPLICIT_SHA256_DIGEST) componentLite.setImplicitSha256Digest(value_); else componentLite = NameLite::Component(value_); }
// Imitate Name::Component::get(NameLite::Component& componentLite). static void toNameComponentLite(PyObject* nameComponent, NameLite::Component& componentLite) { if (toBoolByMethod(nameComponent, str.isImplicitSha256Digest)) componentLite.setImplicitSha256Digest (toBlobLiteByMethod(nameComponent, str.getValue)); else componentLite = NameLite::Component (toBlobLiteByMethod(nameComponent, str.getValue)); }