Rules for a component type holding a nonNegativeInteger value, written as a decimal number in URI representation. More...
#include <name-component-types.hpp>
Public Member Functions | |
DecimalComponentType (uint32_t type, const std::string &typeName, const std::string &uriPrefix) | |
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... | |
![]() | |
virtual | ~ComponentType ()=default |
virtual void | check (const Component &comp) const |
Throw Component::Error if comp is invalid. More... | |
virtual std::pair< bool, Component > | getSuccessor (const Component &comp) const |
Calculate the successor of comp . More... | |
virtual const std::vector< uint8_t > & | getMinValue () const |
Return the minimum allowable TLV-VALUE of this component type. More... | |
Additional Inherited Members | |
![]() | |
using | Error = Component::Error |
![]() | |
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 for a component type holding a nonNegativeInteger value, written as a decimal number in URI representation.
Definition at line 279 of file name-component-types.hpp.
|
inline |
Definition at line 282 of file name-component-types.hpp.
|
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 295 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 301 of file name-component-types.hpp.
References ndn::name::Component::fromNumber(), NDN_THROW, and ndn::to_string().
|
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 320 of file name-component-types.hpp.
References ndn::name::detail::ComponentType::writeUri().