22 #ifndef NDN_NAME_COMPONENT_HPP 23 #define NDN_NAME_COMPONENT_HPP 144 :
Component(type, buffer.data(), buffer.size())
161 Component(uint32_t type,
const uint8_t* value,
size_t count);
179 template<
class Iterator>
188 template<
class Iterator>
214 template<encoding::Tag TAG>
228 wireDecode(
const Block& wire);
240 return fromEscapedString(std::string(input + beginOffset, input + endOffset));
250 return fromEscapedString(std::string(input));
258 fromEscapedString(
const std::string& input);
288 isNumberWithMarker(uint8_t marker)
const;
309 isByteOffset()
const;
315 return isByteOffset();
330 isSequenceNumber()
const;
354 toNumberWithMarker(uint8_t marker)
const;
384 toByteOffset()
const;
390 return toByteOffset();
411 toSequenceNumber()
const;
442 fromNumberWithMarker(uint8_t marker, uint64_t number);
450 fromVersion(uint64_t version);
458 fromSegment(uint64_t segmentNo);
466 fromByteOffset(uint64_t offset);
472 return fromByteOffset(offset);
489 fromSequenceNumber(uint64_t seqNo);
502 isImplicitSha256Digest()
const;
514 fromImplicitSha256Digest(
const uint8_t* digest,
size_t digestSize);
520 isParametersSha256Digest()
const;
532 fromParametersSha256Digest(
const uint8_t* digest,
size_t digestSize);
538 return value_size() == 0;
589 getSuccessor()
const;
660 #endif // NDN_NAME_COMPONENT_HPP void setConventionDecoding(Convention convention)
Set which Naming Conventions style(s) to accept while decoding.
UriFormat
Identify a format of URI representation.
Component(uint32_t type, Iterator first, Iterator last)
Construct a NameComponent of TLV-TYPE type, copying TLV-VALUE from a range.
std::ostream & operator<<(std::ostream &os, const Data &data)
void setConventionEncoding(Convention convention)
Set which Naming Conventions style to use while encoding.
Represents a TLV element of 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.
#define NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
Component(uint32_t type, const Buffer &buffer)
Construct a NameComponent of TLV-TYPE type, copying TLV-VALUE from buffer.
typed name components (revision 2)
bool isSegmentOffset() const
ALTERNATE, unless NDN_NAME_ALT_URI environment variable is set to '0'.
Convention getConventionDecoding()
Return which Naming Conventions style(s) to accept while decoding.
friend bool operator>=(const Component &lhs, const Component &rhs)
friend bool operator>(const Component &lhs, const Component &rhs)
static Component fromEscapedString(const char *input, size_t beginOffset, size_t endOffset)
Decode NameComponent from a URI component.
Block makeBinaryBlock(uint32_t type, const uint8_t *value, size_t length)
Create a TLV block copying TLV-VALUE from raw buffer.
#define NDN_CXX_NODISCARD
Common includes and macros used throughout the library.
uint64_t toSegmentOffset() const
Component(const Buffer &buffer)
Construct a GenericNameComponent, copying TLV-VALUE from buffer.
bool operator<(optional< T > const &x, optional< U > const &y)
bool equals(const Component &other) const
Check if this is the same component as other.
friend bool operator!=(const Component &lhs, const Component &rhs)
prefer alternate format when available
Component(ConstBufferPtr buffer)
Construct a GenericNameComponent, using TLV-VALUE from buffer.
Represents a name component.
Component(Iterator first, Iterator last)
Construct a GenericNameComponent, copying TLV-VALUE from a range.
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.
static Component fromSegmentOffset(uint64_t offset)
bool operator<=(optional< T > const &x, optional< U > const &y)
component markers (revision 1)
Convention getConventionEncoding()
Return which Naming Conventions style to use while encoding.
Convention
Identify a style of NDN Naming Conventions.
General-purpose automatically managed/resized buffer.
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