87 Name(
const char* uri);
93 Name(std::string uri);
113 template<encoding::Tag TAG>
193 getSubName(ssize_t iStartComponent,
size_t nComponents =
npos)
const;
260 append(uint32_t type,
const uint8_t* value,
size_t count)
269 append(
const uint8_t* value,
size_t count)
282 template<
class Iterator>
284 append(uint32_t type, Iterator first, Iterator last)
296 template<
class Iterator>
528 compare(
size_t pos1,
size_t count1,
529 const Name& other,
size_t pos2 = 0,
size_t count2 =
npos)
const;
537 mutable Block m_wire;
603 #endif // NDN_NAME_HPP
static Component fromNumber(uint64_t number)
Create a component encoded as nonNegativeInteger.
static Component fromSequenceNumber(uint64_t seqNo)
Create sequence number component using NDN naming conventions.
const_iterator begin() const
Begin iterator.
const element_container & elements() const
Get container of sub elements.
static Component fromNumberWithMarker(uint8_t marker, uint64_t number)
Create a component encoded as NameComponentWithMarker.
Name getSuccessor() const
Get the successor of a name.
Name & appendImplicitSha256Digest(ConstBufferPtr digest)
Append an ImplicitSha256Digest component.
std::reverse_iterator< iterator > reverse_iterator
std::ostream & operator<<(std::ostream &os, const Data &data)
static const size_t npos
indicates "until the end" in getSubName and compare
Represents a TLV element of NDN packet format.
bool operator<=(const Delegation &lhs, const Delegation &rhs)
bool operator!=(const Data &lhs, const Data &rhs)
Name & appendNumber(uint64_t number)
Append a component with a nonNegativeInteger.
Name & append(const Component &component)
Append a component.
#define NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
static Component fromSegmentOffset(uint64_t offset)
Create segment offset component using NDN naming conventions.
const Component & operator[](ssize_t i) const
Equivalent to get(i)
Name & appendVersion(optional< uint64_t > version=nullopt)
Append a version component.
std::reverse_iterator< const_iterator > const_reverse_iterator
std::size_t hash(T const &v)
static Component fromSegment(uint64_t segmentNo)
Create segment number component using NDN naming conventions.
std::string toUri() const
Get URI representation of the name.
const Block & wireEncode() const
Perform wire encoding, or return existing wire encoding.
const_iterator end() const
End iterator.
bool equals(const Name &other) const
Check if this name equals another name.
const_reverse_iterator rend() const
Reverse end iterator.
Name & appendSegmentOffset(uint64_t offset)
Append a segment byte offset component.
bool hasWire() const
Check if this Name instance already has wire encoding.
Name & append(const Block &value)
Append a GenericNameComponent from a TLV element.
component_container::size_type size_type
Name & append(uint32_t type, Iterator first, Iterator last)
Append a NameComponent of TLV-TYPE type, copying TLV-VALUE from a range.
name::Component Component
size_t size() const
Get number of components.
Name & appendSequenceNumber(uint64_t seqNo)
Append a sequence number component.
size_t elements_size() const
Equivalent to elements().size()
std::istream & operator>>(std::istream &is, Name &name)
Parse URI from stream as Name.
Represents an absolute name.
bool isPrefixOf(const Name &other) const
Check if this name is a prefix of another name.
void push_back(const Block &element)
Append a sub element.
Name & appendTimestamp(optional< time::system_clock::TimePoint > timestamp=nullopt)
Append a timestamp component.
Name & append(Iterator first, Iterator last)
Append a GenericNameComponent, copying TLV-VALUE from a range.
Name & append(const uint8_t *value, size_t count)
Append a GenericNameComponent, copying count bytes at value as TLV-VALUE.
const Component & at(ssize_t i) const
Get the component at the given index.
void push_back(const T &component)
Append a component.
const_reverse_iterator rbegin() const
Reverse begin iterator.
uint32_t type() const
Get TLV-TYPE.
bool operator>(const Delegation &lhs, const Delegation &rhs)
Represents a name component.
int compare(const Name &other) const
Compare this to the other Name using NDN canonical ordering.
bool operator>=(const Delegation &lhs, const Delegation &rhs)
Name deepCopy() const
Make a deep copy of the name, reallocating the underlying memory buffer.
bool empty() const
Check if name is empty.
bool hasWire() const
Check if the Block has fully encoded wire.
PartialName getSubName(ssize_t iStartComponent, size_t nComponents=npos) const
Extract some components as a sub-name (PartialName)
PartialName getPrefix(ssize_t nComponents) const
Extract a prefix of the name.
bool operator==(const Data &lhs, const Data &rhs)
Name & appendImplicitSha256Digest(const uint8_t *digest, size_t digestSize)
Append an ImplicitSha256Digest component.
Name & append(const char *str)
Append a GenericNameComponent, copying TLV-VALUE from a null-terminated string.
component_container::difference_type difference_type
Name & appendNumberWithMarker(uint8_t marker, uint64_t number)
Append a component with a marked number.
static Component fromImplicitSha256Digest(ConstBufferPtr digest)
Create ImplicitSha256DigestComponent component.
void wireDecode(const Block &wire)
Decode name from wire encoding.
Name & append(uint32_t type, const uint8_t *value, size_t count)
Append a NameComponent of TLV-TYPE type, copying count bytes at value as TLV-VALUE.
std::vector< Component > component_container
void clear()
Remove all components.
bool operator<(const Delegation &lhs, const Delegation &rhs)
const nullopt_t nullopt((nullopt_t::init()))
Name & appendSegment(uint64_t segmentNo)
Append a segment number (sequential) component.
Name()
Create an empty name.
shared_ptr< const Buffer > ConstBufferPtr