Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
ndn::Name Class Reference

A Name holds an array of Name::Component and represents an NDN name. More...

#include <name.hpp>

Classes

struct  BreadthFirstLess
 
class  Component
 A Name::Component holds a read-only name component value. More...
 

Public Types

typedef std::vector< Component >::const_iterator const_iterator
 
typedef std::vector< Component >::const_reverse_iterator const_reverse_iterator
 
typedef Component partial_type
 

Public Member Functions

 Name ()
 Create a new Name with no components.
 
 Name (const std::vector< Component > &components)
 Create a new Name, copying the name components. More...
 
 Name (const char *uri)
 Parse the uri according to the NDN URI Scheme and create the name with the components. More...
 
 Name (const std::string &uri)
 Parse the uri according to the NDN URI Scheme and create the name with the components. More...
 
void get (NameLite &nameLite) const
 Set nameLite to point to the components in this name, without copying any memory. More...
 
void set (const NameLite &nameLite)
 Clear this name, and set the components by copying from nameLite. More...
 
void set (const char *uri)
 Parse the uri according to the NDN URI Scheme and set the name with the components. More...
 
void set (const std::string &uri)
 Parse the uri according to the NDN URI Scheme and set the name with the components. More...
 
Nameappend (const uint8_t *value, size_t valueLength)
 Append a new GENERIC component, copying from value of length valueLength. More...
 
Nameappend (const std::vector< uint8_t > &value)
 Append a new GENERIC component, copying from value. More...
 
Nameappend (const Blob &value)
 Append a new GENERIC component, using the existing Blob value. More...
 
Nameappend (const Component &value)
 
Nameappend (const char *value)
 Append a new GENERIC component, copying the bytes from the value string. More...
 
Nameappend (const std::string &value)
 Append a new GENERIC component, copying the bytes from the value string. More...
 
Nameappend (const Name &name)
 Append the components of the given name to this name. More...
 
Name &DEPRECATED_IN_NDN_CPP appendComponent (const uint8_t *value, size_t valueLength)
 
Name &DEPRECATED_IN_NDN_CPP appendComponent (const std::vector< uint8_t > &value)
 
Name &DEPRECATED_IN_NDN_CPP appendComponent (const Blob &value)
 
Name &DEPRECATED_IN_NDN_CPP addComponent (const uint8_t *value, size_t valueLength)
 
Name &DEPRECATED_IN_NDN_CPP addComponent (const std::vector< uint8_t > &value)
 
Name &DEPRECATED_IN_NDN_CPP addComponent (const Blob &value)
 
void clear ()
 Clear all the components.
 
size_t DEPRECATED_IN_NDN_CPP getComponentCount () const
 
const Component &DEPRECATED_IN_NDN_CPP getComponent (size_t i) const
 
Name getSubName (int iStartComponent, size_t nComponents) const
 Get a new name, constructed as a subset of components. More...
 
Name getSubName (int iStartComponent) const
 Get a new name, constructed as a subset of components starting at iStartComponent until the end of the name. More...
 
Name getPrefix (int nComponents) const
 Return a new Name with the first nComponents components of this Name. More...
 
std::string toUri (bool includeScheme=false) const
 Encode this name as a URI. More...
 
std::string DEPRECATED_IN_NDN_CPP to_uri () const
 
NameappendSegment (uint64_t segment)
 Append a component with the encoded segment number according to NDN naming conventions for "Segment number" (marker 0x00). More...
 
NameappendSegmentOffset (uint64_t segmentOffset)
 Append a component with the encoded segment byte offset according to NDN naming conventions for segment "Byte offset" (marker 0xFB). More...
 
Name &DEPRECATED_IN_NDN_CPP appendFinalSegment (uint64_t segment)
 
NameappendVersion (uint64_t version)
 Append a component with the encoded version number according to NDN naming conventions for "Versioning" (marker 0xFD). More...
 
NameappendTimestamp (uint64_t timestamp)
 Append a component with the encoded timestamp according to NDN naming conventions for "Timestamp" (marker 0xFC). More...
 
NameappendSequenceNumber (uint64_t sequenceNumber)
 Append a component with the encoded sequence number according to NDN naming conventions for "Sequencing" (marker 0xFE). More...
 
NameappendImplicitSha256Digest (const Blob &digest)
 Append a component of type ImplicitSha256DigestComponent, so that isImplicitSha256Digest() is true. More...
 
NameappendImplicitSha256Digest (const uint8_t *digest, size_t digestLength)
 Append a component of type ImplicitSha256DigestComponent, so that isImplicitSha256Digest() is true. More...
 
NameappendImplicitSha256Digest (const std::vector< uint8_t > &digest)
 Append a component of type ImplicitSha256DigestComponent, so that isImplicitSha256Digest() is true. More...
 
bool equals (const Name &name) const
 Check if this name has the same component count and components as the given name. More...
 
Name getSuccessor () const
 Get the successor of this name which is defined as follows. More...
 
bool match (const Name &name) const
 Check if the N components of this name are the same as the first N components of the given name. More...
 
bool isPrefixOf (const Name &name) const
 Check if the N components of this name are the same as the first N components of the given name. More...
 
size_t size () const
 Get the number of components. More...
 
Blob wireEncode (WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const
 Encode this Name for a particular wire format. More...
 
void wireDecode (const uint8_t *input, size_t inputLength, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this Name. More...
 
void wireDecode (const std::vector< uint8_t > &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this Name. More...
 
void wireDecode (const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
 Decode the input using a particular wire format and update this Name. More...
 
const Componentget (int i) const
 Get the component at the given index. More...
 
uint64_t getChangeCount () const
 Get the change count, which is incremented each time this object is changed. More...
 
int compare (const Name &other) const
 Compare this to the other Name using NDN canonical ordering. More...
 
int compare (int iStartComponent, size_t nComponents, const Name &other, int iOtherStartComponent, size_t nOtherComponents) const
 Compare a subset of this name to a subset of the other name, equivalent to this->getSubName(iStartComponent, nComponents).compare (other.getSubName(iOtherStartComponent, nOtherComponents)). More...
 
int compare (int iStartComponent, size_t nComponents, const Name &other, int iOtherStartComponent=0) const
 Compare a subset of this name to a subset of the other name, equivalent to this->getSubName(iStartComponent, nComponents).compare (other.getSubName(iOtherStartComponent)), getting all components of other from iOtherStartComponent to the end of the name. More...
 
const Componentoperator[] (int i) const
 
template<class T >
void push_back (const T &component)
 Append the component. More...
 
bool operator== (const Name &name) const
 Check if this name has the same component count and components as the given name. More...
 
bool operator!= (const Name &name) const
 Check if this name has the same component count and components as the given name. More...
 
bool operator<= (const Name &other) const
 Return true if this is less than or equal to the other Name in the NDN canonical ordering. More...
 
bool operator< (const Name &other) const
 Return true if this is less than the other Name in the NDN canonical ordering. More...
 
bool operator>= (const Name &other) const
 Return true if this is less than or equal to the other Name in the NDN canonical ordering. More...
 
bool operator> (const Name &other) const
 Return true if this is greater than the other Name in the NDN canonical ordering. More...
 
const_iterator begin () const
 Begin iterator (const).
 
const_iterator end () const
 End iterator (const).
 
const_reverse_iterator rbegin () const
 Reverse begin iterator (const).
 
const_reverse_iterator rend () const
 Reverse end iterator (const).
 

Static Public Member Functions

static Blob 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 Blob fromEscapedString (const char *escapedString)
 Make a Blob value by decoding the escapedString according to the NDN URI Scheme. More...
 
static Blob fromEscapedString (const std::string &escapedString)
 Make a Blob value by decoding the escapedString according to the NDN URI Scheme. More...
 
static void toEscapedString (const std::vector< uint8_t > &value, std::ostringstream &result)
 Write the value to result, escaping characters according to the NDN URI Scheme. More...
 
static std::string toEscapedString (const std::vector< uint8_t > &value)
 Convert the value by escaping characters according to the NDN URI Scheme. More...
 
static bool DEPRECATED_IN_NDN_CPP breadthFirstLess (const Name &name1, const Name &name2)
 

Detailed Description

A Name holds an array of Name::Component and represents an NDN name.

Constructor & Destructor Documentation

ndn::Name::Name ( const std::vector< Component > &  components)
inline

Create a new Name, copying the name components.

Parameters
componentsA vector of Component
ndn::Name::Name ( const char *  uri)
inline

Parse the uri according to the NDN URI Scheme and create the name with the components.

Parameters
uriThe URI string.
ndn::Name::Name ( const std::string &  uri)
inline

Parse the uri according to the NDN URI Scheme and create the name with the components.

Parameters
uriThe URI string.

Member Function Documentation

Name& DEPRECATED_IN_NDN_CPP ndn::Name::addComponent ( const uint8_t *  value,
size_t  valueLength 
)
inline
Deprecated:
Use append.
Name& DEPRECATED_IN_NDN_CPP ndn::Name::addComponent ( const std::vector< uint8_t > &  value)
inline
Deprecated:
Use append.
Name& DEPRECATED_IN_NDN_CPP ndn::Name::addComponent ( const Blob value)
inline
Deprecated:
Use append.
Name& ndn::Name::append ( const uint8_t *  value,
size_t  valueLength 
)
inline

Append a new GENERIC component, copying from value of length valueLength.

(To append an ImplicitSha256Digest component, use appendImplicitSha256Digest.)

Returns
This name so that you can chain calls to append.
Name& ndn::Name::append ( const std::vector< uint8_t > &  value)
inline

Append a new GENERIC component, copying from value.

(To append an ImplicitSha256Digest component, use appendImplicitSha256Digest.)

Returns
This name so that you can chain calls to append.
Name& ndn::Name::append ( const Blob value)
inline

Append a new GENERIC component, using the existing Blob value.

(To append an ImplicitSha256Digest component, use appendImplicitSha256Digest.)

Returns
This name so that you can chain calls to append.
Name& ndn::Name::append ( const char *  value)
inline

Append a new GENERIC component, copying the bytes from the value string.

NOTE: This does not escape XX values. If you need to escape, use Name::fromEscapedString. Also, if the string has "/", this does not split into separate components. If you need that then use Name(value).

Parameters
valueA null-terminated string with the bytes to copy.
Returns
This name so that you can chain calls to append.
Name& ndn::Name::append ( const std::string &  value)
inline

Append a new GENERIC component, copying the bytes from the value string.

NOTE: This does not escape XX values. If you need to escape, use Name::fromEscapedString. Also, if the string has "/", this does not split into separate components. If you need that then use Name(value).

Parameters
valueA string with the bytes to copy.
Returns
This name so that you can chain calls to append.
Name & ndn::Name::append ( const Name name)

Append the components of the given name to this name.

Parameters
nameThe Name with components to append.
Returns
This name so that you can chain calls to append.
Name& DEPRECATED_IN_NDN_CPP ndn::Name::appendComponent ( const uint8_t *  value,
size_t  valueLength 
)
inline
Deprecated:
Use append.
Name& DEPRECATED_IN_NDN_CPP ndn::Name::appendComponent ( const std::vector< uint8_t > &  value)
inline
Deprecated:
Use append.
Name& DEPRECATED_IN_NDN_CPP ndn::Name::appendComponent ( const Blob value)
inline
Deprecated:
Use append.
Name& DEPRECATED_IN_NDN_CPP ndn::Name::appendFinalSegment ( uint64_t  segment)
inline
Name& ndn::Name::appendImplicitSha256Digest ( const Blob digest)
inline

Append a component of type ImplicitSha256DigestComponent, so that isImplicitSha256Digest() is true.

Parameters
digestThe SHA-256 digest value.
Returns
This name so that you can chain calls to append.
Exceptions
runtime_errorIf the digest length is not ndn_SHA256_DIGEST_SIZE bytes.
Name& ndn::Name::appendImplicitSha256Digest ( const uint8_t *  digest,
size_t  digestLength 
)
inline

Append a component of type ImplicitSha256DigestComponent, so that isImplicitSha256Digest() is true.

Parameters
digestA pointer to the SHA-256 digest value.
digestLengthLength of digest, which must be ndn_SHA256_DIGEST_SIZE.
Returns
This name so that you can chain calls to append.
Exceptions
runtime_errorIf digestLength is not ndn_SHA256_DIGEST_SIZE bytes.
Name& ndn::Name::appendImplicitSha256Digest ( const std::vector< uint8_t > &  digest)
inline

Append a component of type ImplicitSha256DigestComponent, so that isImplicitSha256Digest() is true.

Parameters
digestThe SHA-256 digest value.
Returns
This name so that you can chain calls to append.
Exceptions
runtime_errorIf the digest length is not ndn_SHA256_DIGEST_SIZE bytes.
Name& ndn::Name::appendSegment ( uint64_t  segment)
inline

Append a component with the encoded segment number according to NDN naming conventions for "Segment number" (marker 0x00).

http://named-data.net/doc/tech-memos/naming-conventions.pdf

Parameters
segmentThe segment number.
Returns
This name so that you can chain calls to append.
Name& ndn::Name::appendSegmentOffset ( uint64_t  segmentOffset)
inline

Append a component with the encoded 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
segmentOffsetThe segment byte offset.
Returns
This name so that you can chain calls to append.
Name& ndn::Name::appendSequenceNumber ( uint64_t  sequenceNumber)
inline

Append a component with the encoded sequence number according to NDN naming conventions for "Sequencing" (marker 0xFE).

http://named-data.net/doc/tech-memos/naming-conventions.pdf

Parameters
sequenceNumberThe sequence number.
Returns
This name so that you can chain calls to append.
Name& ndn::Name::appendTimestamp ( uint64_t  timestamp)
inline

Append a component with the encoded timestamp according to NDN naming conventions for "Timestamp" (marker 0xFC).

http://named-data.net/doc/tech-memos/naming-conventions.pdf

Parameters
timestampThe number of microseconds since the UNIX epoch (Thursday, 1 January 1970) not counting leap seconds.
Returns
This name so that you can chain calls to append.
Name& ndn::Name::appendVersion ( uint64_t  version)
inline

Append a component with the encoded version number according to NDN naming conventions for "Versioning" (marker 0xFD).

http://named-data.net/doc/tech-memos/naming-conventions.pdf Note that this encodes the exact value of version without converting from a time representation.

Parameters
versionThe version number.
Returns
This name so that you can chain calls to append.
static bool DEPRECATED_IN_NDN_CPP ndn::Name::breadthFirstLess ( const Name name1,
const Name name2 
)
inlinestatic
Deprecated:
Use operator < .
int ndn::Name::compare ( const Name other) const
inline

Compare this to the other Name using NDN canonical ordering.

If the first components of each name are not equal, this returns -1 if the first comes before the second using the NDN canonical ordering for name components, or 1 if it comes after. If they are equal, this compares the second components of each name, etc. If both names are the same up to the size of the shorter name, this returns -1 if the first name is shorter than the second or 1 if it is longer. For example, std::sort gives: /a/b/d /a/b/cc /c /c/a /bb . This is intuitive because all names with the prefix /a are next to each other. But it may be also be counter-intuitive because /c comes before /bb according to NDN canonical ordering since it is shorter.

Parameters
otherThe other Name to compare with.
Returns
0 If they compare equal, -1 if *this comes before other in the canonical ordering, or 1 if *this comes after other in the canonical ordering.
See also
http://named-data.net/doc/0.2/technical/CanonicalOrder.html
int ndn::Name::compare ( int  iStartComponent,
size_t  nComponents,
const Name other,
int  iOtherStartComponent,
size_t  nOtherComponents 
) const

Compare a subset of this name to a subset of the other name, equivalent to this->getSubName(iStartComponent, nComponents).compare (other.getSubName(iOtherStartComponent, nOtherComponents)).

Parameters
iStartComponentThe index if the first component of this name to get. If iStartComponent is -N then return return components starting from name.size() - N.
nComponentsThe number of components starting at iStartComponent. If greater than the size of this name, get until the end of the name.
otherThe other Name to compare with.
iOtherStartComponentThe index if the first component of the other name to get. If iOtherStartComponent is -N then return return components starting from other.size() - N.
nOtherComponentsThe number of components starting at iOtherStartComponent. If greater than the size of the other name, get until the end of the name.
Returns
0 If the sub names compare equal, -1 if this sub name comes before the other sub name in the canonical ordering, or 1 if after.
int ndn::Name::compare ( int  iStartComponent,
size_t  nComponents,
const Name other,
int  iOtherStartComponent = 0 
) const
inline

Compare a subset of this name to a subset of the other name, equivalent to this->getSubName(iStartComponent, nComponents).compare (other.getSubName(iOtherStartComponent)), getting all components of other from iOtherStartComponent to the end of the name.

Parameters
iStartComponentThe index if the first component of this name to get. If iStartComponent is -N then return return components starting from name.size() - N.
nComponentsThe number of components starting at iStartComponent. If greater than the size of this name, get until the end of the name.
otherThe other Name to compare with.
iOtherStartComponent(optional) The index if the first component of the other name to get. If iOtherStartComponent is -N then return return components starting from other.size() - N. If omitted, use 0.
Returns
0 If the sub names compare equal, -1 if this sub name comes before the other sub name in the canonical ordering, or 1 if after.
bool ndn::Name::equals ( const Name name) const

Check if this name has the same component count and components as the given name.

Parameters
nameThe Name to check.
Returns
true if the names are equal, otherwise false.
Blob ndn::Name::fromEscapedString ( const char *  escapedString,
size_t  beginOffset,
size_t  endOffset 
)
static

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. This does not check for a type code prefix such as "sha256digest=".

Parameters
escapedStringThe escaped string. It does not need to be null-terminated because we only scan to endOffset.
beginOffsetThe offset in escapedString of the beginning of the portion to decode.
endOffsetThe offset in escapedString of the end of the portion to decode.
Returns
The Blob value. If the escapedString is not a valid escaped component, then the Blob is a null pointer.
Blob ndn::Name::fromEscapedString ( const char *  escapedString)
static

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. This does not check for a type code prefix such as "sha256digest=".

Parameters
escapedStringThe null-terminated escaped string.
Returns
The Blob value. If the escapedString is not a valid escaped component, then the Blob is a null pointer.
static Blob ndn::Name::fromEscapedString ( const std::string &  escapedString)
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. This does not check for a type code prefix such as "sha256digest=".

Parameters
escapedStringThe escaped string.
Returns
The Blob value. If the escapedString is not a valid escaped component, then the Blob is a null pointer.
void ndn::Name::get ( NameLite nameLite) const

Set nameLite to point to the components in this name, without copying any memory.

WARNING: The resulting pointers in nameLite are invalid after a further use of this object which could reallocate memory.

Parameters
nameLiteA NameLite where the components array is already allocated.
const Name::Component & ndn::Name::get ( int  i) const

Get the component at the given index.

Parameters
iThe index of the component, starting from 0. However, if i is negative, return the component at size() - (-i).
Returns
The name component at the index.
Exceptions
runtime_errorIf index is out of range.
uint64_t ndn::Name::getChangeCount ( ) const
inline

Get the change count, which is incremented each time this object is changed.

Returns
The change count.
const Component& DEPRECATED_IN_NDN_CPP ndn::Name::getComponent ( size_t  i) const
inline
Deprecated:
Use get(i).
size_t DEPRECATED_IN_NDN_CPP ndn::Name::getComponentCount ( ) const
inline
Name ndn::Name::getPrefix ( int  nComponents) const
inline

Return a new Name with the first nComponents components of this Name.

Parameters
nComponentsThe number of prefix components. If nComponents is -N then return the prefix up to name.size() - N. For example getPrefix(-1) returns the name without the final component.
Returns
A new Name.
Name ndn::Name::getSubName ( int  iStartComponent,
size_t  nComponents 
) const

Get a new name, constructed as a subset of components.

Parameters
iStartComponentThe index if the first component to get. If iStartComponent is -N then return return components starting from name.size() - N.
nComponentsThe number of components starting at iStartComponent. If greater than the size of this name, get until the end of the name.
Returns
A new name.
Name ndn::Name::getSubName ( int  iStartComponent) const
inline

Get a new name, constructed as a subset of components starting at iStartComponent until the end of the name.

Parameters
iStartComponentThe index if the first component to get. If iStartComponent is -N then return return components starting from name.size() - N.
Returns
A new name.
Name ndn::Name::getSuccessor ( ) const

Get the successor of this name which is defined as follows.

N represents the set of NDN Names, and X,Y ∈ N. Operator < is defined by the NDN canonical order on N. Y is the successor of X, if (a) X < Y, and (b) ∄ Z ∈ N s.t. X < Z < Y.

In plain words, the successor of a name is the same name, but with its last component advanced to a next possible value.

Examples:

  • The successor of / is /%00
  • The successor of /%00%01/%01%02 is /%00%01/%01%03
  • The successor of /%00%01/%01FF is /%00%01/%02%00
  • The successor of /%00%01/FFFF is /%00%01/%00%00%00
Returns
A new name which is the successor of this.
bool ndn::Name::isPrefixOf ( const Name name) const
inline

Check if the N components of this name are the same as the first N components of the given name.

Parameters
nameThe Name to check.
Returns
true if this matches the given name, otherwise false. This always returns true if this name is empty.
bool ndn::Name::match ( const Name name) const

Check if the N components of this name are the same as the first N components of the given name.

Parameters
nameThe Name to check.
Returns
true if this matches the given name, otherwise false. This always returns true if this name is empty.
bool ndn::Name::operator!= ( const Name name) const
inline

Check if this name has the same component count and components as the given name.

Parameters
nameThe Name to check.
Returns
true if the names are not equal, otherwise false.
bool ndn::Name::operator< ( const Name other) const
inline

Return true if this is less than the other Name in the NDN canonical ordering.

Parameters
otherThe other Name to compare with.
See also
http://named-data.net/doc/0.2/technical/CanonicalOrder.html
bool ndn::Name::operator<= ( const Name other) const
inline

Return true if this is less than or equal to the other Name in the NDN canonical ordering.

Parameters
otherThe other Name to compare with.
See also
http://named-data.net/doc/0.2/technical/CanonicalOrder.html
bool ndn::Name::operator== ( const Name name) const
inline

Check if this name has the same component count and components as the given name.

Parameters
nameThe Name to check.
Returns
true if the names are equal, otherwise false.
bool ndn::Name::operator> ( const Name other) const
inline

Return true if this is greater than the other Name in the NDN canonical ordering.

Parameters
otherThe other Name to compare with.
See also
http://named-data.net/doc/0.2/technical/CanonicalOrder.html
bool ndn::Name::operator>= ( const Name other) const
inline

Return true if this is less than or equal to the other Name in the NDN canonical ordering.

Parameters
otherThe other Name to compare with.
See also
http://named-data.net/doc/0.2/technical/CanonicalOrder.html
template<class T >
void ndn::Name::push_back ( const T &  component)
inline

Append the component.

Parameters
componentThe component of type T.
void ndn::Name::set ( const NameLite nameLite)

Clear this name, and set the components by copying from nameLite.

Parameters
nameLiteA NameLite object.
void ndn::Name::set ( const char *  uri)

Parse the uri according to the NDN URI Scheme and set the name with the components.

Parameters
uriThe null-terminated URI string.
void ndn::Name::set ( const std::string &  uri)
inline

Parse the uri according to the NDN URI Scheme and set the name with the components.

Parameters
uriThe URI string.
size_t ndn::Name::size ( ) const
inline

Get the number of components.

Returns
The number of components.
std::string DEPRECATED_IN_NDN_CPP ndn::Name::to_uri ( ) const
inline
static void ndn::Name::toEscapedString ( const std::vector< uint8_t > &  value,
std::ostringstream &  result 
)
static

Write the value to result, escaping characters according to the NDN URI Scheme.

This also adds "..." to a value with zero or more ".".

Parameters
valuethe buffer with the value to escape
resultthe string stream to write to.
static std::string ndn::Name::toEscapedString ( const std::vector< uint8_t > &  value)
static

Convert the value by escaping characters according to the NDN URI Scheme.

This also adds "..." to a value with zero or more ".".

Parameters
valuethe buffer with the value to escape
Returns
The escaped string.
string ndn::Name::toUri ( bool  includeScheme = false) const

Encode this name as a URI.

Parameters
includeScheme(optional) If true, include the "ndn:" scheme in the URI, e.g. "ndn:/example/name". If false, just return the path, e.g. "/example/name". If ommitted, then just return the path which is the default case where toUri() is used for display.
Returns
The encoded URI.
void ndn::Name::wireDecode ( const uint8_t *  input,
size_t  inputLength,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)
inline

Decode the input using a particular wire format and update this Name.

Parameters
inputThe input byte array to be decoded.
inputLengthThe length of input.
wireFormat(optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat().
void ndn::Name::wireDecode ( const std::vector< uint8_t > &  input,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)
inline

Decode the input using a particular wire format and update this Name.

Parameters
inputThe input byte array to be decoded.
wireFormat(optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat().
void ndn::Name::wireDecode ( const Blob input,
WireFormat wireFormat = *WireFormat::getDefaultWireFormat() 
)
inline

Decode the input using a particular wire format and update this Name.

Parameters
inputThe input byte array to be decoded as an immutable Blob.
wireFormat(optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat().
Blob ndn::Name::wireEncode ( WireFormat wireFormat = *WireFormat::getDefaultWireFormat()) const
inline

Encode this Name for a particular wire format.

Parameters
wireFormat(optional) A WireFormat object used to encode this Name. If omitted, use WireFormat::getDefaultWireFormat().
Returns
The encoded byte array.

The documentation for this class was generated from the following files: