22 #ifndef NDN_CXX_NAME_COMPONENT_HPP 23 #define NDN_CXX_NAME_COMPONENT_HPP 172 [[deprecated(
"use the constructor that takes a span<>")]]
173 Component(uint32_t type,
const uint8_t* value,
size_t count)
182 [[deprecated(
"use the constructor that takes a span<>")]]
196 template<
class Iterator>
205 template<
class Iterator>
231 template<encoding::Tag TAG>
245 wireDecode(
const Block& wire);
257 return fromEscapedString(std::string(input + beginOffset, input + endOffset));
267 return fromEscapedString(std::string(input));
275 fromEscapedString(
const std::string& input);
305 isNumberWithMarker(uint8_t marker)
const;
319 isByteOffset()
const;
340 isSequenceNumber()
const;
362 toNumberWithMarker(uint8_t marker)
const;
378 toByteOffset()
const;
402 toSequenceNumber()
const;
433 fromNumberWithMarker(uint8_t marker, uint64_t number);
440 fromSegment(uint64_t segmentNo);
447 fromByteOffset(uint64_t offset);
468 fromSequenceNumber(uint64_t seqNo);
487 isImplicitSha256Digest()
const;
493 [[deprecated(
"use one of the name::Component constructors")]]
501 [[deprecated(
"use one of the name::Component constructors")]]
503 fromImplicitSha256Digest(span<const uint8_t> digest);
511 isParametersSha256Digest()
const;
517 [[deprecated(
"use one of the name::Component constructors")]]
525 [[deprecated(
"use one of the name::Component constructors")]]
527 fromParametersSha256Digest(span<const uint8_t> digest);
543 return value_size() == 0;
594 getSuccessor()
const;
661 #endif // NDN_CXX_NAME_COMPONENT_HPP void setConventionDecoding(Convention convention)
Set which Naming Conventions style(s) to accept while decoding.
Same as UriFormat::CANONICAL, unless NDN_NAME_ALT_URI environment variable is set to '1'...
Copyright (c) 2011-2015 Regents of the University of California.
UriFormat
Format used for the URI representation of a name.
Component(uint32_t type, Iterator first, Iterator last)
Construct a NameComponent of TLV-TYPE type, copying TLV-VALUE from a range.
boost::chrono::time_point< system_clock > time_point
std::ostream & operator<<(std::ostream &os, const Data &data)
Same as UriFormat::ALTERNATE, unless NDN_NAME_ALT_URI environment variable is set to '0'...
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Component)
NDN_CXX_NODISCARD bool empty() const
void setConventionEncoding(Convention convention)
Set which Naming Conventions style to use while encoding.
Represents a TLV element of the NDN packet format.
int compare(const Component &other) const
Compare this to the other Component using NDN canonical ordering.
static Component fromEscapedString(const char *input)
Decode NameComponent from a URI component.
Typed name components (revision 3)
bool isGeneric() const noexcept
Check if the component is a GenericNameComponent.
Use the library's default format; currently equivalent to UriFormat::ENV_OR_ALTERNATE.
Convention getConventionDecoding()
Return which Naming Conventions style(s) to accept while decoding.
optional_constexpr bool operator<=(optional< T > const &x, optional< U > const &y)
friend bool operator>=(const Component &lhs, const Component &rhs)
Common includes and macros used throughout the library.
friend bool operator>(const Component &lhs, const Component &rhs)
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.
static Component fromEscapedString(const char *input, size_t beginOffset, size_t endOffset)
Decode NameComponent from a URI component.
#define NDN_CXX_NODISCARD
bool equals(const Component &other) const
Check if this is the same component as other.
friend bool operator!=(const Component &lhs, const Component &rhs)
Always prefer the alternate format when available.
Block makeBinaryBlock(uint32_t type, span< const uint8_t > value)
Create a TLV block copying the TLV-VALUE from a byte range.
Component(ConstBufferPtr buffer)
Construct a GenericNameComponent, using TLV-VALUE from buffer.
bool isKeyword() const noexcept
Check if the component is a KeywordNameComponent.
Represents a name component.
Component(Iterator first, Iterator last)
Construct a GenericNameComponent, copying TLV-VALUE from a range.
Component(span< const uint8_t > buffer)
Construct a GenericNameComponent, copying the TLV-VALUE from buffer.
Always use <type-number>=<percent-encoded-value> format.
Component(const uint8_t *value, size_t count)
Construct a GenericNameComponent, copying count bytes at value as TLV-VALUE.
Component markers (revision 1)
Convention getConventionEncoding()
Return which Naming Conventions style to use while encoding.
Convention
Identify a style of NDN Naming Conventions.
bool operator<(const ReadvertisedRoute &lhs, const ReadvertisedRoute &rhs)
friend bool operator==(const Component &lhs, const Component &rhs)
void toUri(std::ostream &os, UriFormat format=UriFormat::DEFAULT) const
Write *this to the output stream, escaping characters according to the NDN URI format.
Error(const char *expectedType, uint32_t actualType)
shared_ptr< const Buffer > ConstBufferPtr