Component holds a read-only name component value. More...
#include <name-component.hpp>
Data Structures | |
| class | Error |
| Error that can be thrown from name::Component. More... | |
Public Types | |
| typedef std::vector< Block > | element_container |
| typedef element_container::iterator | element_iterator |
| typedef element_container::const_iterator | element_const_iterator |
Public Member Functions | |
| Component () | |
| Create a new Name::Component with a null value. More... | |
| Component (const Block &wire) | |
| Directly create component from wire block. More... | |
| Component (const ConstBufferPtr &buffer) | |
| Create a new Name::Component, taking another pointer to the Blob value. More... | |
| Component (const Buffer &value) | |
| Create a new Name::Component, copying the given value. More... | |
| Component (const uint8_t *value, size_t valueLen) | |
| Create a new Name::Component, copying the given value. More... | |
| template<class InputIterator > | |
| Component (InputIterator begin, InputIterator end) | |
| Component (const char *str) | |
| Component (const std::string &str) | |
| template<bool T> | |
| size_t | wireEncode (EncodingImpl< T > &block) const |
| Fast encoding or block size estimation. More... | |
| const Block & | wireEncode () const |
| Encode to a wire format. More... | |
| void | wireDecode (const Block &wire) |
| Decode from the wire format. More... | |
| void | toEscapedString (std::ostream &result) const |
| Write the value to result, escaping characters according to the NDN URI Scheme. More... | |
| std::string | toEscapedString () const |
| Convert the value by escaping characters according to the NDN URI Scheme. More... | |
| void | toUri (std::ostream &result) const |
| std::string | toUri () const |
| uint64_t | toNumber () const |
| Interpret this name component as nonNegativeInteger. More... | |
| uint64_t | toVersion () const |
| An alias for toNumber() More... | |
| uint64_t | toSegment () const |
| An alias for toNumber() More... | |
| bool | equals (const Component &other) const |
| Check if this is the same component as other. More... | |
| bool | empty () const |
| bool | operator== (const Component &other) const |
| Check if this is the same component as other. More... | |
| bool | operator!= (const Component &other) const |
| Check if this is not the same component as other. More... | |
| int | compare (const Component &other) const |
| Compare this to the other Component using NDN canonical ordering. More... | |
| bool | operator<= (const Component &other) const |
| Return true if this is less than or equal to the other Component in the NDN canonical ordering. More... | |
| bool | operator< (const Component &other) const |
| Return true if this is less than the other Component in the NDN canonical ordering. More... | |
| bool | operator>= (const Component &other) const |
| Return true if this is less than or equal to the other Component in the NDN canonical ordering. More... | |
| bool | operator> (const Component &other) const |
| Return true if this is greater than the other Component in the NDN canonical ordering. More... | |
| bool | hasWire () const |
| Check if the Block has fully encoded wire. More... | |
| bool | hasValue () const |
| Check if the Block has value block (no type and length are encoded) More... | |
| void | reset () |
| Reset wire buffer of the element. More... | |
| void | resetWire () |
| Reset wire buffer but keep sub elements (if any) More... | |
| void | parse () const |
| Parse wire buffer into subblocks. More... | |
| void | encode () |
| Encode subblocks into wire buffer. More... | |
| uint32_t | type () const |
| const Block & | get (uint32_t type) const |
| Get the first subelement of the requested type. More... | |
| element_const_iterator | find (uint32_t type) const |
| void | remove (uint32_t type) |
| element_iterator | erase (element_iterator position) |
| element_iterator | erase (element_iterator first, element_iterator last) |
| void | push_back (const Block &element) |
| Buffer::const_iterator | begin () const |
| Buffer::const_iterator | end () const |
| const uint8_t * | wire () const |
| size_t | size () const |
| Buffer::const_iterator | value_begin () const |
| Buffer::const_iterator | value_end () const |
| const uint8_t * | value () const |
| size_t | value_size () const |
| const element_container & | elements () const |
| Get all subelements. More... | |
| element_const_iterator | elements_begin () const |
| element_const_iterator | elements_end () const |
| size_t | elements_size () const |
| Block | blockFromValue () const |
| bool | operator== (const Block &other) const |
| bool | operator!= (const Block &other) const |
Static Public Member Functions | |
| static Component | fromEscapedString (const char *escapedString, size_t beginOffset, size_t endOffset) |
| Make a Blob value by decoding the escapedString between beginOffset and endOffset according to the NDN URI Scheme. More... | |
| static Component | fromEscapedString (const char *escapedString) |
| Make a Blob value by decoding the escapedString according to the NDN URI Scheme. More... | |
| static Component | fromEscapedString (const std::string &escapedString) |
| Make a Blob value by decoding the escapedString according to the NDN URI Scheme. More... | |
| static Component | fromNumber (uint64_t number) |
| Create a component encoded as nonNegativeInteger. More... | |
| static bool | fromBuffer (const ConstBufferPtr &wire, size_t offset, Block &block) |
| Try to construct block from Buffer, referencing data block pointed by wire. More... | |
| static bool | fromBuffer (const uint8_t *buffer, size_t maxSize, Block &block) |
| Try to construct block from Buffer, referencing data block pointed by wire. More... | |
Protected Attributes | |
| ConstBufferPtr | m_buffer |
| uint32_t | m_type |
| Buffer::const_iterator | m_begin |
| Buffer::const_iterator | m_end |
| uint32_t | m_size |
| Buffer::const_iterator | m_value_begin |
| Buffer::const_iterator | m_value_end |
| element_container | m_subBlocks |
Component holds a read-only name component value.
Definition at line 24 of file name-component.hpp.
|
inherited |
|
inherited |
|
inherited |
|
inline |
Create a new Name::Component with a null value.
Definition at line 310 of file name-component.hpp.
|
inline |
Directly create component from wire block.
Any block can be implicitly converted to name::Component
| Error | if wire.type() is not Tlv::Component |
Definition at line 316 of file name-component.hpp.
|
inlineexplicit |
Create a new Name::Component, taking another pointer to the Blob value.
| value | A blob with a pointer to an immutable array. The pointer is copied. |
Definition at line 324 of file name-component.hpp.
|
inlineexplicit |
Create a new Name::Component, copying the given value.
| value | The value byte array. |
Definition at line 330 of file name-component.hpp.
|
inline |
Create a new Name::Component, copying the given value.
| value | Pointer to the value byte array. |
| valueLen | Length of value. |
Definition at line 336 of file name-component.hpp.
|
inline |
Definition at line 343 of file name-component.hpp.
|
inlineexplicit |
Definition at line 349 of file name-component.hpp.
|
inlineexplicit |
Definition at line 355 of file name-component.hpp.
|
inlineinherited |
|
inline |
Compare this to the other Component using NDN canonical ordering.
| other | The other Component to compare with. |
Definition at line 455 of file name-component.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 228 of file name-component.hpp.
|
inherited |
|
inlineinherited |
|
inline |
Check if this is the same component as other.
| other | The other Component to compare with. |
Definition at line 215 of file name-component.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
staticinherited |
|
staticinherited |
|
inlinestatic |
Make a Blob value by decoding the escapedString between beginOffset and endOffset according to the NDN URI Scheme.
If the escaped string is "", "." or ".." then return a Blob with a null pointer, which means the component should be skipped in a URI name.
| escapedString | The escaped string. It does not need to be null-terminated because we only scan to endOffset. |
| beginOffset | The offset in escapedString of the beginning of the portion to decode. |
| endOffset | The offset in escapedString of the end of the portion to decode. |
Definition at line 362 of file name-component.hpp.
|
inlinestatic |
Make a Blob value by decoding the escapedString according to the NDN URI Scheme.
If the escaped string is "", "." or ".." then return a Blob with a null pointer, which means the component should be skipped in a URI name.
| escapedString | The null-terminated escaped string. |
Definition at line 123 of file name-component.hpp.
|
inlinestatic |
Make a Blob value by decoding the escapedString according to the NDN URI Scheme.
If the escaped string is "", "." or ".." then return a Blob with a null pointer, which means the component should be skipped in a URI name.
| escapedString | The escaped string. |
Definition at line 136 of file name-component.hpp.
|
inlinestatic |
Create a component encoded as nonNegativeInteger.
| number | The non-negative number |
Definition at line 427 of file name-component.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Check if this is not the same component as other.
| other | The other Component to compare with. |
Definition at line 247 of file name-component.hpp.
|
inlineinherited |
|
inline |
Return true if this is less than the other Component in the NDN canonical ordering.
| other | The other Component to compare with. |
Definition at line 276 of file name-component.hpp.
|
inline |
Return true if this is less than or equal to the other Component in the NDN canonical ordering.
| other | The other Component to compare with. |
Definition at line 267 of file name-component.hpp.
|
inline |
Check if this is the same component as other.
| other | The other Component to compare with. |
Definition at line 239 of file name-component.hpp.
|
inlineinherited |
|
inline |
Return true if this is greater than the other Component in the NDN canonical ordering.
| other | The other Component to compare with. |
Definition at line 294 of file name-component.hpp.
|
inline |
Return true if this is less than or equal to the other Component in the NDN canonical ordering.
| other | The other Component to compare with. |
Definition at line 285 of file name-component.hpp.
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Write the value to result, escaping characters according to the NDN URI Scheme.
This also adds "..." to a value with zero or more ".".
| value | the buffer with the value to escape |
| result | the string stream to write to. |
Definition at line 383 of file name-component.hpp.
|
inline |
Convert the value by escaping characters according to the NDN URI Scheme.
This also adds "..." to a value with zero or more ".".
| value | the buffer with the value to escape |
Definition at line 157 of file name-component.hpp.
|
inline |
Interpret this name component as nonNegativeInteger.
Definition at line 435 of file name-component.hpp.
|
inline |
An alias for toNumber()
Definition at line 449 of file name-component.hpp.
|
inline |
Definition at line 165 of file name-component.hpp.
|
inline |
Definition at line 171 of file name-component.hpp.
|
inline |
An alias for toNumber()
Definition at line 443 of file name-component.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Decode from the wire format.
Definition at line 506 of file name-component.hpp.
|
inline |
Fast encoding or block size estimation.
Definition at line 473 of file name-component.hpp.
|
inline |
Encode to a wire format.
Definition at line 487 of file name-component.hpp.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |
|
protectedinherited |