22 #ifndef NDN_NAME_COMPONENT_HPP 23 #define NDN_NAME_COMPONENT_HPP 135 :
Component(type, buffer.data(), buffer.size())
152 Component(uint32_t type,
const uint8_t* value,
size_t count);
170 template<
class Iterator>
179 template<
class Iterator>
205 template<encoding::Tag TAG>
207 wireEncode(EncodingImpl<TAG>& encoder)
const;
219 wireDecode(
const Block& wire);
231 return fromEscapedString(std::string(input + beginOffset, input + endOffset));
241 return fromEscapedString(std::string(input));
249 fromEscapedString(
const std::string& input);
259 toUri(std::ostream& os)
const;
284 isNumberWithMarker(uint8_t marker)
const;
305 isByteOffset()
const;
311 return isByteOffset();
326 isSequenceNumber()
const;
349 toNumberWithMarker(uint8_t marker)
const;
379 toByteOffset()
const;
385 return toByteOffset();
406 toSequenceNumber()
const;
440 fromNumberWithMarker(uint8_t marker, uint64_t number);
448 fromVersion(uint64_t version);
456 fromSegment(uint64_t segmentNo);
464 fromByteOffset(uint64_t offset);
470 return fromByteOffset(offset);
487 fromSequenceNumber(uint64_t seqNo);
500 isImplicitSha256Digest()
const;
512 fromImplicitSha256Digest(
const uint8_t* digest,
size_t digestSize);
518 isParametersSha256Digest()
const;
530 fromParametersSha256Digest(
const uint8_t* digest,
size_t digestSize);
536 return value_size() == 0;
570 return equals(other);
581 return !equals(other);
593 return compare(other) <= 0;
605 return compare(other) < 0;
617 return compare(other) >= 0;
629 return compare(other) > 0;
658 getSuccessor()
const;
688 #endif // NDN_NAME_COMPONENT_HPP void setConventionDecoding(Convention convention)
Set which Naming Conventions style(s) to accept while decoding.
uint64_t toSegmentOffset() const
Component(uint32_t type, Iterator first, Iterator last)
Construct a NameComponent of TLV-TYPE type, copying TLV-VALUE from a range.
bool operator==(const Component &other) const
Check if this is the same component as other.
std::ostream & operator<<(std::ostream &os, const Component &component)
void setConventionEncoding(Convention convention)
Set which Naming Conventions style to use while encoding.
Represents a TLV element of NDN packet format.
bool operator<=(const Delegation &lhs, const Delegation &rhs)
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)
Convention getConventionDecoding()
Return which Naming Conventions style(s) to accept while decoding.
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.
void toUri(std::ostream &os) const
Write *this to the output stream, escaping characters according to the NDN URI Scheme.
import common constructs for ndn-cxx library internal use
bool operator!=(const Component &other) const
Check if this is not the same component as other.
Component(const Buffer &buffer)
Construct a GenericNameComponent, copying TLV-VALUE from buffer.
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.
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)
component markers (revision 1)
Convention getConventionEncoding()
Return which Naming Conventions style to use while encoding.
bool isSegmentOffset() const
Convention
Identify a style of NDN Naming Conventions.
General-purpose automatically managed/resized buffer.
bool operator>=(const Component &other) const
Check if the *this is greater or equal than the other in NDN canonical ordering.
bool operator<(const Delegation &lhs, const Delegation &rhs)
Error(const char *expectedType, uint32_t actualType)
bool operator>(const Component &other) const
Check if the *this is greater than the other in NDN canonical ordering.
shared_ptr< const Buffer > ConstBufferPtr