86 Name(
const char* uri);
92 Name(std::string uri);
112 template<encoding::Tag TAG>
192 getSubName(ssize_t iStartComponent,
size_t nComponents =
npos)
const;
259 append(uint32_t type,
const uint8_t* value,
size_t count)
268 append(
const uint8_t* value,
size_t count)
281 template<
class Iterator>
283 append(uint32_t type, Iterator first, Iterator last)
295 template<
class Iterator>
547 compare(
size_t pos1,
size_t count1,
548 const Name& other,
size_t pos2 = 0,
size_t count2 =
npos)
const;
556 mutable Block m_wire;
622 #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.
Copyright (c) 2013-2017 Regents of the University of California.
Name & appendTimestamp()
Append a timestamp component based on current time.
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 & appendTimestamp(const time::system_clock::TimePoint &timePoint)
Append a timestamp component.
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)
Name & appendVersion(uint64_t version)
Append a version component.
static Component fromTimestamp(const time::system_clock::TimePoint &timePoint)
Create sequence number component using NDN naming conventions.
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)
std::reverse_iterator< const_iterator > const_reverse_iterator
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 & 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.
static Component fromVersion(uint64_t version)
Create version component using NDN naming conventions.
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)
Name & appendSegment(uint64_t segmentNo)
Append a segment number (sequential) component.
Name & appendVersion()
Append a version component based on current time.
Name()
Create an empty name.
shared_ptr< const Buffer > ConstBufferPtr