Project

General

Profile

Actions

Task #2088

closed

name::Component::is(Segment|Timestamp|SequenceNumber|...)

Added by Alex Afanasyev over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
10/24/2014
Due date:
% Done:

100%

Estimated time:

Description

Right now, there is no reliable way to check if the name component follows the specific naming convention. The only way is to try to convert and catch the exception.

The following should be added to name::Component API:

partial name::Component {
  /**
   * @brief Check if the component is nonNegativeInteger per NDN naming conventions
   */
  bool
  isNumber() const;

  /**
   * @brief Check if the component is NameComponentWithMarker per NDN naming conventions
   */
  bool
  isNumberWithMarker(uint8_t marker) const;

  /**
   * @brief Check if the component is version per NDN naming conventions
   */
  bool
  isVersion() const;

  /**
   * @brief Check if the component is segment number per NDN naming conventions
   */
  bool
  isSegment() const;

  /**
   * @brief Check if the component is segment offset per NDN naming conventions
   */
  bool
  isSegmentOffset() const;

  /**
   * @brief Check if the component is timestamp per NDN naming conventions
   */
  bool
  isTimestamp() const;

  /**
   * @brief Check if the component is sequence number per NDN naming conventions
   */
  bool
  isSequenceNumber() const;

  /**
   * @brief Check if the component is ImplicitSha256DigestComponent
   */
  bool
  isImplicitSha256Digest() const;
}
Actions

Also available in: Atom PDF