ndn::name Namespace Reference

Classes

class  Component
 Represents a name component. More...
 

Enumerations

enum  : uint8_t {
  SEGMENT_MARKER = 0x00,
  SEGMENT_OFFSET_MARKER = 0xFB,
  VERSION_MARKER = 0xFD,
  TIMESTAMP_MARKER = 0xFC,
  SEQUENCE_NUMBER_MARKER = 0xFE
}
 Name component markers defined in Naming Conventions revision 1. More...
 
enum  Convention {
  Convention::MARKER = 1 << 0,
  Convention::TYPED = 1 << 1,
  Convention::EITHER = MARKER | TYPED
}
 Identify a style of NDN Naming Conventions. More...
 
enum  UriFormat {
  UriFormat::CANONICAL,
  UriFormat::ALTERNATE,
  UriFormat::ENV_OR_CANONICAL,
  UriFormat::ENV_OR_ALTERNATE,
  UriFormat::DEFAULT = ENV_OR_ALTERNATE
}
 Format used for the URI representation of a name. More...
 

Functions

static bool canDecodeMarkerConvention ()
 
static bool canDecodeTypedConvention ()
 
template size_t Component ::wireEncode<::ndn::encoding::EncoderTag > (::ndn::EncodingBuffer &) const
 
template size_t Component ::wireEncode<::ndn::encoding::EstimatorTag > (::ndn::EncodingEstimator &) const
 
Convention getConventionDecoding ()
 Return which Naming Conventions style(s) to accept while decoding. More...
 
Convention getConventionEncoding ()
 Return which Naming Conventions style to use while encoding. More...
 
static Component parseUriEscapedValue (uint32_t type, const char *input, size_t len)
 
void setConventionDecoding (Convention convention)
 Set which Naming Conventions style(s) to accept while decoding. More...
 
void setConventionEncoding (Convention convention)
 Set which Naming Conventions style to use while encoding. More...
 
static bool wantAltUri (UriFormat format)
 

Variables

static Convention g_conventionDecoding = Convention::EITHER
 
static Convention g_conventionEncoding = Convention::MARKER
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : uint8_t

Name component markers defined in Naming Conventions revision 1.

See also
https://named-data.net/publications/techreports/ndn-tr-22-ndn-memo-naming-conventions/
Enumerator
SEGMENT_MARKER 
SEGMENT_OFFSET_MARKER 
VERSION_MARKER 
TIMESTAMP_MARKER 
SEQUENCE_NUMBER_MARKER 

Definition at line 61 of file name-component.hpp.

◆ Convention

enum ndn::name::Convention
strong

Identify a style of NDN Naming Conventions.

See also
https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
Enumerator
MARKER 

Component markers (revision 1)

TYPED 

Typed name components (revision 2)

EITHER 

Definition at line 52 of file name-component.hpp.

◆ UriFormat

enum ndn::name::UriFormat
strong

Format used for the URI representation of a name.

See also
http://named-data.net/doc/NDN-packet-spec/current/name.html#ndn-uri-scheme
Enumerator
CANONICAL 

Always use <type-number>=<percent-encoded-value> format.

ALTERNATE 

Always prefer the alternate format when available.

ENV_OR_CANONICAL 

Same as UriFormat::CANONICAL, unless NDN_NAME_ALT_URI environment variable is set to '1'.

ENV_OR_ALTERNATE 

Same as UriFormat::ALTERNATE, unless NDN_NAME_ALT_URI environment variable is set to '0'.

DEFAULT 

Use the library's default format; currently equivalent to UriFormat::ENV_OR_ALTERNATE.

Definition at line 36 of file name-component.hpp.

Function Documentation

◆ canDecodeMarkerConvention()

static bool ndn::name::canDecodeMarkerConvention ( )
static

Definition at line 80 of file name-component.cpp.

◆ canDecodeTypedConvention()

static bool ndn::name::canDecodeTypedConvention ( )
static

Definition at line 86 of file name-component.cpp.

◆ Component ::wireEncode<::ndn::encoding::EncoderTag >()

template size_t ndn::name::Component ::wireEncode<::ndn::encoding::EncoderTag > ( ::ndn::EncodingBuffer &  ) const

◆ Component ::wireEncode<::ndn::encoding::EstimatorTag >()

template size_t ndn::name::Component ::wireEncode<::ndn::encoding::EstimatorTag > ( ::ndn::EncodingEstimator &  ) const

◆ getConventionDecoding()

Convention ndn::name::getConventionDecoding ( )

Return which Naming Conventions style(s) to accept while decoding.

The current library default is Convention::EITHER, but this will change in the future.

Definition at line 68 of file name-component.cpp.

◆ getConventionEncoding()

Convention ndn::name::getConventionEncoding ( )

Return which Naming Conventions style to use while encoding.

The current library default is Convention::MARKER, but this will change in the future.

Definition at line 49 of file name-component.cpp.

◆ parseUriEscapedValue()

static Component ndn::name::parseUriEscapedValue ( uint32_t  type,
const char *  input,
size_t  len 
)
static

Definition at line 163 of file name-component.cpp.

◆ setConventionDecoding()

void ndn::name::setConventionDecoding ( Convention  convention)

Set which Naming Conventions style(s) to accept while decoding.

Parameters
conventionConvention::MARKER or Convention::TYPED accepts the specified style only; Convention::EITHER accepts either.

Definition at line 74 of file name-component.cpp.

◆ setConventionEncoding()

void ndn::name::setConventionEncoding ( Convention  convention)

Set which Naming Conventions style to use while encoding.

Parameters
conventioneither Convention::MARKER or Convention::TYPED.

Definition at line 55 of file name-component.cpp.

◆ wantAltUri()

static bool ndn::name::wantAltUri ( UriFormat  format)
static

Definition at line 92 of file name-component.cpp.

Variable Documentation

◆ g_conventionDecoding

Convention ndn::name::g_conventionDecoding = Convention::EITHER
static

Definition at line 46 of file name-component.cpp.

◆ g_conventionEncoding

Convention ndn::name::g_conventionEncoding = Convention::MARKER
static

Definition at line 45 of file name-component.cpp.