A NameLite::Component holds a pointer to the component value.
More...
#include <name-lite.hpp>
|
|
| Component () |
| | Create a NameLite::Component of zero size.
|
| |
| | Component (const uint8_t *value, size_t valueLength) |
| | Create a NameLite::Component with the given value. More...
|
| |
|
const BlobLite & | getValue () const |
| |
| uint64_t | toNumber () const |
| | Interpret the name component as a network-ordered number and return an integer. More...
|
| |
| ndn_Error | toNumberWithMarker (uint8_t marker, uint64_t &result) const |
| | Interpret the name component as a network-ordered number with a marker and return an integer. More...
|
| |
| ndn_Error | toNumberWithPrefix (const uint8_t *prefix, size_t prefixLength, uint64_t &result) const |
| | Interpret the name component as a network-ordered number with a prefix and return an integer. More...
|
| |
| bool | hasPrefix (const uint8_t *prefix, size_t prefixLength) const |
| | Check if this name component begins with the given prefix. More...
|
| |
| ndn_Error | toSegment (uint64_t &result) const |
| | Interpret this name component as a segment number according to NDN naming conventions for "Segment number" (marker 0x00). More...
|
| |
| ndn_Error | toSegmentOffset (uint64_t &result) const |
| | Interpret this name component as a segment byte offset according to NDN naming conventions for segment "Byte offset" (marker 0xFB). More...
|
| |
| ndn_Error | toVersion (uint64_t &result) const |
| | Interpret this name component as a version number according to NDN naming conventions for "Versioning" (marker 0xFD). More...
|
| |
| ndn_Error | toTimestamp (uint64_t &result) const |
| | Interpret this name component as a timestamp according to NDN naming conventions for "Timestamp" (marker 0xFC). More...
|
| |
| ndn_Error | toSequenceNumber (uint64_t &result) const |
| | Interpret this name component as a sequence number according to NDN naming conventions for "Sequencing" (marker 0xFE). More...
|
| |
| int | compare (const Component &other) const |
| | Compare this component to the other component using NDN component ordering. More...
|
| |
A NameLite::Component holds a pointer to the component value.
| ndn::NameLite::Component::Component |
( |
const uint8_t * |
value, |
|
|
size_t |
valueLength |
|
) |
| |
Create a NameLite::Component with the given value.
- Parameters
-
| value | The pre-allocated buffer for the value. |
| valueLength | The number of bytes in value. |
| int ndn::NameLite::Component::compare |
( |
const Component & |
other | ) |
const |
Compare this component to the other component using NDN component ordering.
A component is less if it is shorter, otherwise if equal length do a byte comparison.
- Parameters
-
| other | The other name component to compare with. |
- Returns
- -1 if self is less than other, 1 if greater or 0 if equal.
| bool ndn::NameLite::Component::hasPrefix |
( |
const uint8_t * |
prefix, |
|
|
size_t |
prefixLength |
|
) |
| const |
Check if this name component begins with the given prefix.
- Parameters
-
| prefix | The required prefix of the component. |
| prefixLength | The length of prefix. |
- Returns
- True if this component begins with the prefix.
| uint64_t ndn::NameLite::Component::toNumber |
( |
| ) |
const |
Interpret the name component as a network-ordered number and return an integer.
- Returns
- The integer number.
| ndn_Error ndn::NameLite::Component::toNumberWithMarker |
( |
uint8_t |
marker, |
|
|
uint64_t & |
result |
|
) |
| const |
Interpret the name component as a network-ordered number with a marker and return an integer.
- Parameters
-
| marker | The required first byte of the component. |
| result | Return the integer number. |
- Returns
- 0 for success, or an error code if the first byte of the component does not equal the marker.
| ndn_Error ndn::NameLite::Component::toNumberWithPrefix |
( |
const uint8_t * |
prefix, |
|
|
size_t |
prefixLength, |
|
|
uint64_t & |
result |
|
) |
| const |
Interpret the name component as a network-ordered number with a prefix and return an integer.
- Parameters
-
| prefix | The required prefix of the component. |
| prefixLength | The length of prefix. |
| result | Return the integer number. |
- Returns
- 0 for success, or an error code if the first bytes of the component do not equal the prefix.
| ndn_Error ndn::NameLite::Component::toSegment |
( |
uint64_t & |
result | ) |
const |
Interpret this name component as a segment number according to NDN naming conventions for "Segment number" (marker 0x00).
http://named-data.net/doc/tech-memos/naming-conventions.pdf
- Parameters
-
| result | Return the integer segment number. |
- Returns
- 0 for success, or an error code if the first byte of the component is not the expected marker.
| ndn_Error ndn::NameLite::Component::toSegmentOffset |
( |
uint64_t & |
result | ) |
const |
Interpret this name component as a segment byte offset according to NDN naming conventions for segment "Byte offset" (marker 0xFB).
http://named-data.net/doc/tech-memos/naming-conventions.pdf
- Parameters
-
| result | Return the integer segment byte offset. |
- Returns
- 0 for success, or an error code if the first byte of the component is not the expected marker.
| ndn_Error ndn::NameLite::Component::toSequenceNumber |
( |
uint64_t & |
result | ) |
const |
Interpret this name component as a sequence number according to NDN naming conventions for "Sequencing" (marker 0xFE).
http://named-data.net/doc/tech-memos/naming-conventions.pdf
- Parameters
-
| result | Return the integer sequence number. |
- Returns
- 0 for success, or an error code if the first byte of the component is not the expected marker.
| ndn_Error ndn::NameLite::Component::toTimestamp |
( |
uint64_t & |
result | ) |
const |
Interpret this name component as a timestamp according to NDN naming conventions for "Timestamp" (marker 0xFC).
http://named-data.net/doc/tech-memos/naming-conventions.pdf
- Parameters
-
| result | Return the number of microseconds since the UNIX epoch (Thursday, 1 January 1970) not counting leap seconds. |
- Returns
- 0 for success, or an error code if the first byte of the component is not the expected marker.
| ndn_Error ndn::NameLite::Component::toVersion |
( |
uint64_t & |
result | ) |
const |
Interpret this name component as a version number according to NDN naming conventions for "Versioning" (marker 0xFD).
Note that this returns the exact number from the component without converting it to a time representation.
- Parameters
-
| result | Return the integer version number. |
- Returns
- 0 for success, or an error code if the first byte of the component is not the expected marker.
The documentation for this class was generated from the following files: