Rules regarding a component type holding a SHA256 digest value. More...
#include <name-component-types.hpp>
Public Member Functions | |
Sha256ComponentType (uint32_t type, const std::string &typeName, const std::string &uriPrefix) | |
bool | match (const Component &comp) const |
void | check (const Component &comp) const final |
Throw Component::Error if comp is invalid. More... | |
Component | create (ConstBufferPtr value) const |
Component | create (const uint8_t *value, size_t valueSize) const |
std::pair< bool, Component > | getSuccessor (const Component &comp) const final |
Calculate the successor of comp . More... | |
const std::vector< uint8_t > & | getMinValue () const final |
Return the minimum allowable TLV-VALUE of this component type. More... | |
const char * | getAltUriPrefix () const final |
Return the prefix of the alternate URI representation. More... | |
Component | parseAltUriValue (const std::string &input) const final |
Parse component from alternate URI representation. More... | |
void | writeUri (std::ostream &os, const Component &comp) const final |
Write URI representation of comp to os . More... | |
Public Member Functions inherited from ndn::name::detail::ComponentType | |
virtual | ~ComponentType ()=default |
Additional Inherited Members | |
Public Types inherited from ndn::name::detail::ComponentType | |
using | Error = Component::Error |
Protected Member Functions inherited from ndn::name::detail::ComponentType | |
std::pair< bool, Block > | getSuccessorImpl (const Component &comp) const |
Calculate the successor of comp , extending TLV-LENGTH if value overflows. More... | |
void | writeUriEscapedValue (std::ostream &os, const Component &comp) const |
Write TLV-VALUE as <escaped-value> of NDN URI syntax. More... | |
Rules regarding a component type holding a SHA256 digest value.
Definition at line 172 of file name-component-types.hpp.
|
inline |
Definition at line 175 of file name-component-types.hpp.
|
inline |
Definition at line 183 of file name-component-types.hpp.
References ndn::util::Sha256::DIGEST_SIZE, ndn::Block::type(), and ndn::Block::value_size().
Referenced by check(), ndn::name::Component::isImplicitSha256Digest(), and ndn::name::Component::isParametersSha256Digest().
|
inlinefinalvirtual |
Throw Component::Error if comp
is invalid.
Reimplemented from ndn::name::detail::ComponentType.
Definition at line 189 of file name-component-types.hpp.
References ndn::util::Sha256::DIGEST_SIZE, match(), and ndn::to_string().
|
inline |
Definition at line 198 of file name-component-types.hpp.
Referenced by ndn::name::Component::fromImplicitSha256Digest(), and ndn::name::Component::fromParametersSha256Digest().
|
inline |
Definition at line 204 of file name-component-types.hpp.
References ndn::encoding::makeBinaryBlock().
|
inlinefinalvirtual |
Calculate the successor of comp
.
If comp
is the maximum possible value of this component type, return true to indicate that the successor should have a greater TLV-TYPE.
Reimplemented from ndn::name::detail::ComponentType.
Definition at line 210 of file name-component-types.hpp.
References ndn::name::detail::ComponentType::getSuccessorImpl().
|
inlinefinalvirtual |
Return the minimum allowable TLV-VALUE of this component type.
Reimplemented from ndn::name::detail::ComponentType.
Definition at line 222 of file name-component-types.hpp.
References ndn::util::Sha256::DIGEST_SIZE.
|
inlinefinalvirtual |
Return the prefix of the alternate URI representation.
NDN URI specification allows a name component type to declare an alternate URI representation in the form of <prefix>=<value>
, in addition to the plain <type-number>=<escaped-value>
syntax.
<prefix>
portion of the alternate URI representation. nullptr | this component does not have an alternate URI representation. |
Reimplemented from ndn::name::detail::ComponentType.
Definition at line 229 of file name-component-types.hpp.
|
inlinefinalvirtual |
Parse component from alternate URI representation.
input | the <value> portion of the alternate URI representation. |
Component::Error |
Reimplemented from ndn::name::detail::ComponentType.
Definition at line 235 of file name-component-types.hpp.
References ndn::fromHex().
|
inlinefinalvirtual |
Write URI representation of comp
to os
.
This base class implementation encodes the component in the plain <type-number>=<escaped-value>
syntax.
Reimplemented from ndn::name::detail::ComponentType.
Definition at line 248 of file name-component-types.hpp.
References ndn::printHex().