94 Name(
const char* uri);
100 Name(std::string uri);
120 template<encoding::Tag TAG>
200 getSubName(ssize_t iStartComponent,
size_t nComponents =
npos)
const;
279 append(
const uint8_t* value,
size_t valueLength)
292 template<
class Iterator>
296 static_assert(
sizeof(
typename std::iterator_traits<Iterator>::value_type) == 1,
297 "iterator does not dereference to one-octet value type");
531 compare(
size_t pos1,
size_t count1,
532 const Name& other,
size_t pos2 = 0,
size_t count2 =
npos)
const;
540 mutable Block m_wire;
606 #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.
Name & appendTimestamp()
Append a timestamp component based on current time.
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.
Name & appendTimestamp(const time::system_clock::TimePoint &timePoint)
Append a timestamp component.
const Block & wireEncode() const
Perform wire encoding, or return existing wire encoding.
Name & append(const char *value)
Append a component, copying from a zero-terminated byte string.
const_iterator end() const
End iterator.
const Component & operator[](ssize_t i) const
Equivalent to get(i)
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 & appendVersion(uint64_t version)
Append a version component.
Name getSuccessor() const
Get the successor of a name.
const_reverse_iterator rend() const
Reverse end iterator.
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.
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.
const element_container & elements() const
Get container of sub elements.
std::reverse_iterator< const_iterator > const_reverse_iterator
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 component, decoding from a Block.
component_container::size_type size_type
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 & append(Iterator first, Iterator last)
Append a component, copying from [first, last)
size_t elements_size() const
Equivalent to elements().size()
Error(const std::string &what)
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)
Component holds a read-only name component value.
static Component fromImplicitSha256Digest(const ConstBufferPtr &digest)
Create ImplicitSha256DigestComponent component.
bool operator>=(const Delegation &lhs, const Delegation &rhs)
Name & append(const uint8_t *value, size_t valueLength)
Append a component, copying from [value, value + valueLength)
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.
static Component fromVersion(uint64_t version)
Create version component using NDN naming conventions.
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.
void wireDecode(const Block &wire)
Decode name from wire encoding.
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)
uint32_t type() const
Get TLV-TYPE.
Name & appendSegment(uint64_t segmentNo)
Append a segment number (sequential) component.
Name & appendImplicitSha256Digest(const ConstBufferPtr &digest)
Append an ImplicitSha256Digest component.
Name & appendVersion()
Append a version component based on current time.
Name()
Create an empty name.
Error that can be thrown from name::Component.
bool hasWire() const
Check if this Name instance already has wire encoding.
shared_ptr< const Buffer > ConstBufferPtr