87 Name(
const char* uri);
93 Name(std::string uri);
113 template<encoding::Tag TAG>
162 return reinterpret_cast<const Component&>(m_wire.
elements()[i]);
193 getSubName(ssize_t iStartComponent,
size_t nComponents =
npos)
const;
217 return reinterpret_cast<const_iterator>(m_wire.
elements().data());
225 return reinterpret_cast<const_iterator>(m_wire.
elements().data() + m_wire.
elements().size());
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.
const Component * const_iterator
static Component fromSequenceNumber(uint64_t seqNo)
Create sequence number component using NDN naming conventions.
PartialName getPrefix(ssize_t nComponents) const
Extract a prefix of the name.
bool hasWire() const
Check if the Block has fully encoded wire.
Copyright (c) 2011-2015 Regents of the University of California.
std::string toUri() const
Get URI representation of the name.
bool equals(const Name &other) const
Check if this name equals another name.
static Component fromNumberWithMarker(uint8_t marker, uint64_t number)
Create a component encoded as NameComponentWithMarker.
const Block & wireEncode() const
Perform wire encoding, or return existing wire encoding.
const_iterator end() const
End iterator.
const Component & get(ssize_t i) const
Get the component at the given index.
const Component & operator[](ssize_t i) const
Equivalent to get(i)
Name & appendImplicitSha256Digest(ConstBufferPtr digest)
Append an ImplicitSha256Digest component.
std::reverse_iterator< iterator > reverse_iterator
std::ostream & operator<<(std::ostream &os, const Data &data)
bool isPrefixOf(const Name &other) const
Check if this name is a prefix of another name.
Name getSuccessor() const
Get the successor of a name.
const_reverse_iterator rend() const
Reverse end iterator.
static const size_t npos
indicates "until the end" in getSubName and compare
Represents a TLV element of NDN packet format.
const_reverse_iterator rbegin() const
Reverse begin iterator.
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.
static Component fromSegmentOffset(uint64_t offset)
Create segment offset component using NDN naming conventions.
Name & appendVersion(optional< uint64_t > version=nullopt)
Append a version component.
const element_container & elements() const
Get container of sub elements.
std::reverse_iterator< const_iterator > const_reverse_iterator
std::size_t hash(T const &v)
const Component & at(ssize_t i) const
Get the component at the given index.
static Component fromSegment(uint64_t segmentNo)
Create segment number component using NDN naming conventions.
int compare(const Name &other) const
Compare this to the other Name using NDN canonical ordering.
Name & appendSegmentOffset(uint64_t offset)
Append a segment byte offset component.
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
Name & appendSequenceNumber(uint64_t seqNo)
Append a sequence number component.
std::istream & operator>>(std::istream &is, Name &name)
Parse URI from stream as Name.
Represents an absolute 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.
size_t elements_size() const
Equivalent to elements().size()
Name & append(const uint8_t *value, size_t count)
Append a GenericNameComponent, copying count bytes at value as TLV-VALUE.
const_iterator begin() const
Begin iterator.
void push_back(const T &component)
Append a component.
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Exclude)
size_t size() const
Get number of components.
bool operator>(const Delegation &lhs, const Delegation &rhs)
Represents a name component.
bool operator>=(const Delegation &lhs, const Delegation &rhs)
bool empty() const
Check if name is empty.
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.
Name deepCopy() const
Make a deep copy of the name, reallocating the underlying memory buffer.
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)
PartialName getSubName(ssize_t iStartComponent, size_t nComponents=npos) const
Extract some components as a sub-name (PartialName)
const nullopt_t nullopt((nullopt_t::init()))
uint32_t type() const
Get TLV-TYPE.
Name & appendSegment(uint64_t segmentNo)
Append a segment number (sequential) component.
Name()
Create an empty name.
bool hasWire() const
Check if this Name instance already has wire encoding.
shared_ptr< const Buffer > ConstBufferPtr