Represents a name component. More...
#include <name-component.hpp>
Classes | |
class | Error |
Public Member Functions | |
Component (uint32_t type=tlv::GenericNameComponent) | |
Construct a NameComponent of TLV-TYPE type , using empty TLV-VALUE. More... | |
Component (const Block &wire) | |
Construct a NameComponent from block . More... | |
Component (uint32_t type, ConstBufferPtr buffer) | |
Construct a NameComponent of TLV-TYPE type , using TLV-VALUE from buffer . More... | |
Component (ConstBufferPtr buffer) | |
Construct a GenericNameComponent, using TLV-VALUE from buffer . More... | |
Component (uint32_t type, const Buffer &buffer) | |
Construct a NameComponent of TLV-TYPE type , copying TLV-VALUE from buffer . More... | |
Component (const Buffer &buffer) | |
Construct a GenericNameComponent, copying TLV-VALUE from buffer . More... | |
Component (uint32_t type, const uint8_t *value, size_t count) | |
Construct a NameComponent of TLV-TYPE type , copying count bytes at value as TLV-VALUE. More... | |
Component (const uint8_t *value, size_t count) | |
Construct a GenericNameComponent, copying count bytes at value as TLV-VALUE. More... | |
template<class Iterator > | |
Component (uint32_t type, Iterator first, Iterator last) | |
Construct a NameComponent of TLV-TYPE type , copying TLV-VALUE from a range. More... | |
template<class Iterator > | |
Component (Iterator first, Iterator last) | |
Construct a GenericNameComponent, copying TLV-VALUE from a range. More... | |
Component (const char *str) | |
Construct a GenericNameComponent, copying TLV-VALUE from a null-terminated string. More... | |
Component (const std::string &str) | |
Construct a GenericNameComponent, copying TLV-VALUE from a string. More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
Fast encoding or block size estimation. More... | |
const Block & | wireEncode () const |
Encode to a wire format. More... | |
void | wireDecode (const Block &wire) |
Decode from the wire format. More... | |
void | toUri (std::ostream &os) const |
Write *this to the output stream, escaping characters according to the NDN URI Scheme. More... | |
std::string | toUri () const |
Convert *this by escaping characters according to the NDN URI Scheme. More... | |
bool | isNumber () const |
Check if the component is nonNegativeInteger. More... | |
bool | isNumberWithMarker (uint8_t marker) const |
Check if the component is NameComponentWithMarker per NDN naming conventions. More... | |
bool | isVersion () const |
Check if the component is version per NDN naming conventions. More... | |
bool | isSegment () const |
Check if the component is segment number per NDN naming conventions. More... | |
bool | isSegmentOffset () const |
Check if the component is segment offset per NDN naming conventions. More... | |
bool | isTimestamp () const |
Check if the component is timestamp per NDN naming conventions. More... | |
bool | isSequenceNumber () const |
Check if the component is sequence number per NDN naming conventions. More... | |
uint64_t | toNumber () const |
Interpret this name component as nonNegativeInteger. More... | |
uint64_t | toNumberWithMarker (uint8_t marker) const |
Interpret this name component as NameComponentWithMarker. More... | |
uint64_t | toVersion () const |
Interpret as version component using NDN naming conventions. More... | |
uint64_t | toSegment () const |
Interpret as segment number component using NDN naming conventions. More... | |
uint64_t | toSegmentOffset () const |
Interpret as segment offset component using NDN naming conventions. More... | |
time::system_clock::TimePoint | toTimestamp () const |
Interpret as timestamp component using NDN naming conventions. More... | |
uint64_t | toSequenceNumber () const |
Interpret as sequence number component using NDN naming conventions. More... | |
bool | isGeneric () const |
Check if the component is GenericComponent. More... | |
bool | isImplicitSha256Digest () const |
Check if the component is ImplicitSha256DigestComponent. More... | |
bool | isParametersSha256Digest () const |
Check if the component is ParametersSha256DigestComponent. More... | |
bool | empty () const |
bool | equals (const Component &other) const |
Check if this is the same component as other. More... | |
int | compare (const Component &other) const |
Compare this to the other Component using NDN canonical ordering. More... | |
bool | operator== (const Component &other) const |
Check if this is the same component as other. More... | |
bool | operator!= (const Component &other) const |
Check if this is not the same component as other. More... | |
bool | operator<= (const Component &other) const |
Check if the *this is less than or equal to the other in NDN canonical ordering. More... | |
bool | operator< (const Component &other) const |
Check if the *this is less than the other in NDN canonical ordering. More... | |
bool | operator>= (const Component &other) const |
Check if the *this is greater or equal than the other in NDN canonical ordering. More... | |
bool | operator> (const Component &other) const |
Check if the *this is greater than the other in NDN canonical ordering. More... | |
Component | getSuccessor () const |
Get the successor of this name component. More... | |
Public Member Functions inherited from ndn::Block | |
Block () | |
Create an empty Block. More... | |
Block (const Block &) | |
Copy constructor. More... | |
Block & | operator= (const Block &) |
Copy assignment operator. More... | |
Block (Block &&) noexcept | |
Move constructor. More... | |
Block & | operator= (Block &&) noexcept |
Move assignment operator. More... | |
Block (const EncodingBuffer &buffer) | |
Parse Block from an EncodingBuffer. More... | |
Block (const ConstBufferPtr &buffer) | |
Parse Block from a wire Buffer. More... | |
Block (ConstBufferPtr buffer, Buffer::const_iterator begin, Buffer::const_iterator end, bool verifyLength=true) | |
Parse Block within boundaries of a wire Buffer. More... | |
Block (const Block &block, Buffer::const_iterator begin, Buffer::const_iterator end, bool verifyLength=true) | |
Parse Block within boundaries of an existing Block, reusing underlying wire Buffer. More... | |
Block (ConstBufferPtr buffer, uint32_t type, Buffer::const_iterator begin, Buffer::const_iterator end, Buffer::const_iterator valueBegin, Buffer::const_iterator valueEnd) | |
Create a Block from a wire Buffer without parsing. More... | |
Block (const uint8_t *buf, size_t bufSize) | |
Parse Block from a raw buffer. More... | |
Block (uint32_t type) | |
Create an empty Block with specified TLV-TYPE. More... | |
Block (uint32_t type, ConstBufferPtr value) | |
Create a Block with specified TLV-TYPE and TLV-VALUE. More... | |
Block (uint32_t type, const Block &value) | |
Create a Block with specified TLV-TYPE and TLV-VALUE. More... | |
bool | empty () const |
Check if the Block is empty. More... | |
bool | hasWire () const |
Check if the Block has fully encoded wire. More... | |
void | reset () |
Reset wire buffer of the element. More... | |
void | resetWire () |
Reset wire buffer but keep TLV-TYPE and sub elements (if any) More... | |
Buffer::const_iterator | begin () const |
Get begin iterator of encoded wire. More... | |
Buffer::const_iterator | end () const |
Get end iterator of encoded wire. More... | |
const uint8_t * | wire () const |
Get pointer to encoded wire. More... | |
size_t | size () const |
Get size of encoded wire, including Type-Length-Value. More... | |
shared_ptr< const Buffer > | getBuffer () const |
Get underlying buffer. More... | |
uint32_t | type () const |
Get TLV-TYPE. More... | |
bool | hasValue () const |
Get begin iterator of TLV-VALUE. More... | |
Buffer::const_iterator | value_begin () const |
Get begin iterator of TLV-VALUE. More... | |
Buffer::const_iterator | value_end () const |
Get end iterator of TLV-VALUE. More... | |
const uint8_t * | value () const |
Get pointer to TLV-VALUE. More... | |
size_t | value_size () const |
Get size of TLV-VALUE aka TLV-LENGTH. More... | |
Block | blockFromValue () const |
void | parse () const |
Parse TLV-VALUE into sub elements. More... | |
void | encode () |
Encode sub elements into TLV-VALUE. More... | |
const Block & | get (uint32_t type) const |
Get the first sub element of specified TLV-TYPE. More... | |
element_const_iterator | find (uint32_t type) const |
Find the first sub element of specified TLV-TYPE. More... | |
void | remove (uint32_t type) |
Remove all sub elements of specified TLV-TYPE. More... | |
element_iterator | erase (element_const_iterator position) |
Erase a sub element. More... | |
element_iterator | erase (element_const_iterator first, element_const_iterator last) |
Erase a range of sub elements. More... | |
void | push_back (const Block &element) |
Append a sub element. More... | |
element_iterator | insert (element_const_iterator pos, const Block &element) |
Insert a sub element. More... | |
const element_container & | elements () const |
Get container of sub elements. More... | |
element_const_iterator | elements_begin () const |
Equivalent to elements().begin() More... | |
element_const_iterator | elements_end () const |
Equivalent to elements().end() More... | |
size_t | elements_size () const |
Equivalent to elements().size() More... | |
operator boost::asio::const_buffer () const | |
Implicit conversion to const_buffer. More... | |
Static Public Member Functions | |
static Component | fromEscapedString (const char *input, size_t beginOffset, size_t endOffset) |
Decode NameComponent from a URI component. More... | |
static Component | fromEscapedString (const char *input) |
Decode NameComponent from a URI component. More... | |
static Component | fromEscapedString (const std::string &input) |
Decode NameComponent from a URI component. More... | |
static Component | fromNumber (uint64_t number) |
Create a component encoded as nonNegativeInteger. More... | |
static Component | fromNumberWithMarker (uint8_t marker, uint64_t number) |
Create a component encoded as NameComponentWithMarker. More... | |
static Component | fromVersion (uint64_t version) |
Create version component using NDN naming conventions. More... | |
static Component | fromSegment (uint64_t segmentNo) |
Create segment number component using NDN naming conventions. More... | |
static Component | fromSegmentOffset (uint64_t offset) |
Create segment offset component using NDN naming conventions. More... | |
static Component | fromTimestamp (const time::system_clock::TimePoint &timePoint) |
Create sequence number component using NDN naming conventions. More... | |
static Component | fromSequenceNumber (uint64_t seqNo) |
Create sequence number component using NDN naming conventions. More... | |
static Component | fromImplicitSha256Digest (ConstBufferPtr digest) |
Create ImplicitSha256DigestComponent component. More... | |
static Component | fromImplicitSha256Digest (const uint8_t *digest, size_t digestSize) |
Create ImplicitSha256DigestComponent component. More... | |
static Component | fromParametersSha256Digest (ConstBufferPtr digest) |
Create ParametersSha256DigestComponent component. More... | |
static Component | fromParametersSha256Digest (const uint8_t *digest, size_t digestSize) |
Create ParametersSha256DigestComponent component. More... | |
Static Public Member Functions inherited from ndn::Block | |
static Block | fromStream (std::istream &is) |
Parse Block from an input stream. More... | |
static std::tuple< bool, Block > | fromBuffer (ConstBufferPtr buffer, size_t offset) |
Try to parse Block from a wire buffer. More... | |
static std::tuple< bool, Block > | fromBuffer (const uint8_t *buf, size_t bufSize) |
Try to parse Block from a raw buffer. More... | |
Additional Inherited Members | |
Public Types inherited from ndn::Block | |
using | element_container = std::vector< Block > |
using | element_iterator = element_container::iterator |
using | element_const_iterator = element_container::const_iterator |
Protected Attributes inherited from ndn::Block | |
shared_ptr< const Buffer > | m_buffer |
underlying buffer storing TLV-VALUE and possibly TLV-TYPE and TLV-LENGTH fields More... | |
Buffer::const_iterator | m_begin |
Buffer::const_iterator | m_end |
Buffer::const_iterator | m_valueBegin |
Buffer::const_iterator | m_valueEnd |
uint32_t | m_type = std::numeric_limits<uint32_t>::max() |
TLV-TYPE. More... | |
size_t | m_size = 0 |
total size including Type-Length-Value More... | |
element_container | m_elements |
sub elements More... | |
Represents a name component.
The Component
class provides a read-only view of a Block
interpreted as a name component. Although it inherits mutation methods from Block
base class, they must not be used, because the enclosing Name
would not be updated correctly.
Definition at line 50 of file name-component.hpp.
|
explicit |
Construct a NameComponent of TLV-TYPE type
, using empty TLV-VALUE.
Error | the NameComponent is invalid (see ensureValid ). |
Definition at line 52 of file name-component.cpp.
Referenced by getSuccessor().
ndn::name::Component::Component | ( | const Block & | wire | ) |
Construct a NameComponent from block
.
Error | the NameComponent is invalid (see ensureValid ). |
This contructor enables implicit conversion from Block
.
Definition at line 58 of file name-component.cpp.
ndn::name::Component::Component | ( | uint32_t | type, |
ConstBufferPtr | buffer | ||
) |
Construct a NameComponent of TLV-TYPE type
, using TLV-VALUE from buffer
.
Error | the NameComponent is invalid (see ensureValid ). |
This constructor does not copy the underlying buffer, but retains a pointer to it. Therefore, the caller must not change the underlying buffer.
Definition at line 64 of file name-component.cpp.
|
inlineexplicit |
Construct a GenericNameComponent, using TLV-VALUE from buffer
.
Error | the NameComponent is invalid (see ensureValid ). |
This constructor does not copy the underlying buffer, but retains a pointer to it. Therefore, the caller must not change the underlying buffer.
Definition at line 92 of file name-component.hpp.
|
inline |
Construct a NameComponent of TLV-TYPE type
, copying TLV-VALUE from buffer
.
Definition at line 100 of file name-component.hpp.
|
inlineexplicit |
Construct a GenericNameComponent, copying TLV-VALUE from buffer
.
Definition at line 109 of file name-component.hpp.
ndn::name::Component::Component | ( | uint32_t | type, |
const uint8_t * | value, | ||
size_t | count | ||
) |
Construct a NameComponent of TLV-TYPE type
, copying count
bytes at value
as TLV-VALUE.
Definition at line 70 of file name-component.cpp.
|
inline |
Construct a GenericNameComponent, copying count
bytes at value
as TLV-VALUE.
Definition at line 123 of file name-component.hpp.
|
inline |
Construct a NameComponent of TLV-TYPE type
, copying TLV-VALUE from a range.
Iterator | an InputIterator dereferencing to a one-octet value type. More efficient implementation is available when it is a RandomAccessIterator . |
type | the TLV-TYPE. |
first | beginning of the range. |
last | past-end of the range. |
Definition at line 137 of file name-component.hpp.
|
inline |
Construct a GenericNameComponent, copying TLV-VALUE from a range.
Definition at line 146 of file name-component.hpp.
|
explicit |
Construct a GenericNameComponent, copying TLV-VALUE from a null-terminated string.
Bytes from the string are copied as is, and not interpreted as URI component.
Definition at line 76 of file name-component.cpp.
|
explicit |
Construct a GenericNameComponent, copying TLV-VALUE from a string.
Bytes from the string are copied as is, and not interpreted as URI component.
Definition at line 81 of file name-component.cpp.
size_t ndn::name::Component::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Fast encoding or block size estimation.
Definition at line 397 of file name-component.cpp.
References ndn::Block::type(), ndn::Block::value(), and ndn::Block::value_size().
const Block & ndn::name::Component::wireEncode | ( | ) | const |
Encode to a wire format.
Definition at line 410 of file name-component.cpp.
References ndn::Block::hasWire().
void ndn::name::Component::wireDecode | ( | const Block & | wire | ) |
Decode from the wire format.
Definition at line 426 of file name-component.cpp.
References ndn::Block::wire().
|
inlinestatic |
Decode NameComponent from a URI component.
The URI component is read from [input+beginOffset, input+endOffset)
range.
Error | URI component does not represent a valid NameComponent. |
Definition at line 195 of file name-component.hpp.
Referenced by fromEscapedString(), and ndn::Name::Name().
|
inlinestatic |
Decode NameComponent from a URI component.
Error | URI component does not represent a valid NameComponent. |
Definition at line 205 of file name-component.hpp.
References fromEscapedString().
|
static |
Decode NameComponent from a URI component.
Error | URI component does not represent a valid NameComponent. |
Definition at line 102 of file name-component.cpp.
References ndn::Block::find(), ndn::name::detail::ComponentTypeTable::findByUriPrefix(), ndn::tlv::GenericNameComponent, ndn::name::detail::getComponentTypeTable(), ndn::tlv::NameComponentMax, ndn::tlv::NameComponentMin, ndn::name::parseUriEscapedValue(), ndn::to_string(), and ndn::Block::type().
void ndn::name::Component::toUri | ( | std::ostream & | os | ) | const |
Write *this to the output stream, escaping characters according to the NDN URI Scheme.
This also adds "..." to a value with zero or more "."
os | The output stream where to write the URI escaped version of *this |
Definition at line 126 of file name-component.cpp.
References ndn::name::detail::ComponentTypeTable::get(), ndn::name::detail::getComponentTypeTable(), ndn::Block::type(), and ndn::name::detail::ComponentType::writeUri().
Referenced by ndn::name::operator<<().
std::string ndn::name::Component::toUri | ( | ) | const |
Convert *this by escaping characters according to the NDN URI Scheme.
This also adds "..." to a value with zero or more "."
Definition at line 132 of file name-component.cpp.
bool ndn::name::Component::isNumber | ( | ) | const |
Check if the component is nonNegativeInteger.
Definition at line 142 of file name-component.cpp.
References ndn::Block::value_size().
Referenced by toNumber().
bool ndn::name::Component::isNumberWithMarker | ( | uint8_t | marker | ) | const |
Check if the component is NameComponentWithMarker per NDN naming conventions.
Definition at line 149 of file name-component.cpp.
References empty(), ndn::Block::value(), and ndn::Block::value_size().
Referenced by isSegment(), isSegmentOffset(), isSequenceNumber(), isTimestamp(), isVersion(), and toNumberWithMarker().
bool ndn::name::Component::isVersion | ( | ) | const |
Check if the component is version per NDN naming conventions.
Definition at line 157 of file name-component.cpp.
References isNumberWithMarker(), and ndn::name::VERSION_MARKER.
Referenced by nfd::fw::Strategy::makeInstanceName().
bool ndn::name::Component::isSegment | ( | ) | const |
Check if the component is segment number per NDN naming conventions.
Definition at line 163 of file name-component.cpp.
References isNumberWithMarker(), and ndn::name::SEGMENT_MARKER.
bool ndn::name::Component::isSegmentOffset | ( | ) | const |
Check if the component is segment offset per NDN naming conventions.
Definition at line 169 of file name-component.cpp.
References isNumberWithMarker(), and ndn::name::SEGMENT_OFFSET_MARKER.
bool ndn::name::Component::isTimestamp | ( | ) | const |
Check if the component is timestamp per NDN naming conventions.
Definition at line 175 of file name-component.cpp.
References isNumberWithMarker(), and ndn::name::TIMESTAMP_MARKER.
bool ndn::name::Component::isSequenceNumber | ( | ) | const |
Check if the component is sequence number per NDN naming conventions.
Definition at line 181 of file name-component.cpp.
References isNumberWithMarker(), and ndn::name::SEQUENCE_NUMBER_MARKER.
uint64_t ndn::name::Component::toNumber | ( | ) | const |
Interpret this name component as nonNegativeInteger.
Definition at line 189 of file name-component.cpp.
References isNumber(), and ndn::encoding::readNonNegativeInteger().
uint64_t ndn::name::Component::toNumberWithMarker | ( | uint8_t | marker | ) | const |
Interpret this name component as NameComponentWithMarker.
marker | 1-byte octet of the marker |
Error | if name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification. |
Definition at line 198 of file name-component.cpp.
References isNumberWithMarker(), ndn::tlv::readNonNegativeInteger(), ndn::Block::value_begin(), ndn::Block::value_end(), and ndn::Block::value_size().
Referenced by toSegment(), toSegmentOffset(), toSequenceNumber(), toTimestamp(), and toVersion().
uint64_t ndn::name::Component::toVersion | ( | ) | const |
Interpret as version component using NDN naming conventions.
Error | if name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification. |
Definition at line 209 of file name-component.cpp.
References toNumberWithMarker(), and ndn::name::VERSION_MARKER.
uint64_t ndn::name::Component::toSegment | ( | ) | const |
Interpret as segment number component using NDN naming conventions.
Error | if name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification. |
Definition at line 215 of file name-component.cpp.
References ndn::name::SEGMENT_MARKER, and toNumberWithMarker().
uint64_t ndn::name::Component::toSegmentOffset | ( | ) | const |
Interpret as segment offset component using NDN naming conventions.
Error | if name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification. |
Definition at line 221 of file name-component.cpp.
References ndn::name::SEGMENT_OFFSET_MARKER, and toNumberWithMarker().
time::system_clock::TimePoint ndn::name::Component::toTimestamp | ( | ) | const |
Interpret as timestamp component using NDN naming conventions.
Error | if name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification. |
Definition at line 227 of file name-component.cpp.
References ndn::time::getUnixEpoch(), ndn::name::TIMESTAMP_MARKER, toNumberWithMarker(), and ndn::Block::value().
uint64_t ndn::name::Component::toSequenceNumber | ( | ) | const |
Interpret as sequence number component using NDN naming conventions.
Error | if name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification. |
Definition at line 234 of file name-component.cpp.
References ndn::name::SEQUENCE_NUMBER_MARKER, and toNumberWithMarker().
|
static |
Create a component encoded as nonNegativeInteger.
number | The non-negative number |
Definition at line 242 of file name-component.cpp.
References ndn::tlv::GenericNameComponent, and ndn::encoding::makeNonNegativeIntegerBlock().
Referenced by ndn::Name::appendNumber(), ndn::security::tpm::BackEnd::createKey(), and ndn::security::CommandInterestPreparer::prepareCommandInterestName().
|
static |
Create a component encoded as NameComponentWithMarker.
NameComponentWithMarker is defined as:
NameComponentWithMarker ::= NAME-COMPONENT-TYPE TLV-LEGTH Marker includedNonNegativeInteger Marker ::= BYTE includedNonNegativeInteger ::= BYTE{1,2,4,8} NDN-TLV := TLV-TYPE TLV-LENGTH TLV-VALUE? TLV-TYPE := VAR-NUMBER TLV-LENGTH := VAR-NUMBER TLV-VALUE := BYTE+
marker | 1-byte marker octet |
number | The non-negative number |
Definition at line 248 of file name-component.cpp.
References ndn::tlv::GenericNameComponent, and ndn::encoding::Estimator::prependNonNegativeInteger().
Referenced by ndn::Name::appendNumberWithMarker(), fromSegment(), fromSegmentOffset(), fromSequenceNumber(), fromTimestamp(), and fromVersion().
|
static |
Create version component using NDN naming conventions.
Definition at line 268 of file name-component.cpp.
References fromNumberWithMarker(), and ndn::name::VERSION_MARKER.
Referenced by ndn::Name::appendVersion().
|
static |
Create segment number component using NDN naming conventions.
Definition at line 274 of file name-component.cpp.
References fromNumberWithMarker(), and ndn::name::SEGMENT_MARKER.
Referenced by ndn::Name::appendSegment().
|
static |
Create segment offset component using NDN naming conventions.
Definition at line 280 of file name-component.cpp.
References fromNumberWithMarker(), and ndn::name::SEGMENT_OFFSET_MARKER.
Referenced by ndn::Name::appendSegmentOffset().
|
static |
Create sequence number component using NDN naming conventions.
Definition at line 286 of file name-component.cpp.
References fromNumberWithMarker(), ndn::time::getUnixEpoch(), ndn::name::TIMESTAMP_MARKER, and ndn::Block::value().
Referenced by ndn::Name::appendTimestamp().
|
static |
Create sequence number component using NDN naming conventions.
Definition at line 294 of file name-component.cpp.
References fromNumberWithMarker(), and ndn::name::SEQUENCE_NUMBER_MARKER.
Referenced by ndn::Name::appendSequenceNumber().
bool ndn::name::Component::isGeneric | ( | ) | const |
Check if the component is GenericComponent.
Definition at line 302 of file name-component.cpp.
References ndn::tlv::GenericNameComponent, and ndn::Block::type().
Referenced by ndn::Exclude::wireDecode().
bool ndn::name::Component::isImplicitSha256Digest | ( | ) | const |
Check if the component is ImplicitSha256DigestComponent.
Definition at line 308 of file name-component.cpp.
References ndn::name::detail::getComponentType1(), and ndn::name::detail::Sha256ComponentType::match().
Referenced by ndn::Interest::matchesData(), and ndn::Exclude::wireDecode().
|
static |
Create ImplicitSha256DigestComponent component.
Definition at line 314 of file name-component.cpp.
References ndn::name::detail::Sha256ComponentType::create(), and ndn::name::detail::getComponentType1().
Referenced by ndn::Name::appendImplicitSha256Digest().
|
static |
Create ImplicitSha256DigestComponent component.
Definition at line 320 of file name-component.cpp.
References ndn::name::detail::Sha256ComponentType::create(), and ndn::name::detail::getComponentType1().
bool ndn::name::Component::isParametersSha256Digest | ( | ) | const |
Check if the component is ParametersSha256DigestComponent.
Definition at line 326 of file name-component.cpp.
References ndn::name::detail::getComponentType2(), and ndn::name::detail::Sha256ComponentType::match().
|
static |
Create ParametersSha256DigestComponent component.
Definition at line 332 of file name-component.cpp.
References ndn::name::detail::Sha256ComponentType::create(), and ndn::name::detail::getComponentType2().
|
static |
Create ParametersSha256DigestComponent component.
Definition at line 338 of file name-component.cpp.
References ndn::name::detail::Sha256ComponentType::create(), and ndn::name::detail::getComponentType2().
|
inline |
Definition at line 485 of file name-component.hpp.
References ndn::Block::value_size().
Referenced by compare(), equals(), isNumberWithMarker(), ndn::KeyParams::KeyParams(), and ndn::security::tpm::BackEnd::setKeyName().
bool ndn::name::Component::equals | ( | const Component & | other | ) | const |
Check if this is the same component as other.
other | The other Component to compare with |
Definition at line 346 of file name-component.cpp.
References empty(), ndn::Block::type(), ndn::Block::value_begin(), ndn::Block::value_end(), and ndn::Block::value_size().
Referenced by operator!=(), and operator==().
int ndn::name::Component::compare | ( | const Component & | other | ) | const |
Compare this to the other Component using NDN canonical ordering.
other | The other Component to compare with. |
negative | this comes before other in canonical ordering |
zero | this equals other |
positive | this comes after other in canonical ordering |
Definition at line 355 of file name-component.cpp.
References empty(), ndn::Block::hasWire(), ndn::Block::size(), ndn::Block::type(), ndn::Block::value(), ndn::Block::value_size(), and ndn::Block::wire().
Referenced by ndn::Name::compare(), operator<(), operator<=(), operator>(), and operator>=().
|
inline |
Check if this is the same component as other.
other | The other Component to compare with. |
Definition at line 519 of file name-component.hpp.
References equals().
|
inline |
Check if this is not the same component as other.
other | The other Component to compare with |
Definition at line 530 of file name-component.hpp.
References equals().
|
inline |
Check if the *this is less than or equal to the other in NDN canonical ordering.
other | The other Component to compare with |
Definition at line 542 of file name-component.hpp.
References compare().
|
inline |
Check if the *this is less than the other in NDN canonical ordering.
other | The other Component to compare with |
Definition at line 554 of file name-component.hpp.
References compare().
|
inline |
Check if the *this is greater or equal than the other in NDN canonical ordering.
other | The other Component to compare with |
Definition at line 566 of file name-component.hpp.
References compare().
|
inline |
Check if the *this is greater than the other in NDN canonical ordering.
other | The other Component to compare with |
Definition at line 578 of file name-component.hpp.
References compare().
Component ndn::name::Component::getSuccessor | ( | ) | const |
Get the successor of this name component.
The successor of a name component is defined as follows:
C represents the set of name components, and X,Y ∈ C. Operator < is defined by canonical order on C. Y is the successor of X, if (a) X < Y, and (b) ∄ Z ∈ C s.t. X < Z < Y.
In plain words, successor of a name component is the next possible name component.
Examples:
sha256digest=0000000000000000000000000000000000000000000000000000000000000000
is sha256digest=0000000000000000000000000000000000000000000000000000000000000001
.sha256digest=ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
is params-sha256=0000000000000000000000000000000000000000000000000000000000000000
.params-sha256=0000000000000000000000000000000000000000000000000000000000000000
is params-sha256=0000000000000000000000000000000000000000000000000000000000000001
.params-sha256=ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
is 3=...
....
is %00
.A
is B
.FF
is %00%00
. Definition at line 380 of file name-component.cpp.
References Component(), ndn::name::detail::ComponentTypeTable::get(), ndn::name::detail::getComponentTypeTable(), ndn::name::detail::ComponentType::getMinValue(), ndn::name::detail::ComponentType::getSuccessor(), ndn::Block::type(), and ndn::Block::value().
Referenced by ndn::security::v2::CertificateBundleFetcher::doFetch().