Project

General

Profile

Feature #3450

Updated by Alex Afanasyev over 8 years ago

The `is*` methods are needed in many cases in order to avoid awkward checks that rely on exceptions: 

 ```cpp ``` 
   /** 
    * @brief Check if the component is nonNegativeInteger 
    * @see http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding 
    */ 
   bool 
   isNumber() const; 

   /** 
    * @brief Check if the component is NameComponentWithMarker per NDN naming conventions 
    * @see http://named-data.net/doc/tech-memos/naming-conventions.pdf 
    */ 
   bool 
   isNumberWithMarker(uint8_t marker) const; 

   /** 
    * @brief Check if the component is version per NDN naming conventions 
    * @see http://named-data.net/doc/tech-memos/naming-conventions.pdf 
    */ 
   bool 
   isVersion() const; 

   /** 
    * @brief Check if the component is segment number per NDN naming conventions 
    * @see http://named-data.net/doc/tech-memos/naming-conventions.pdf 
    */ 
   bool 
   isSegment() const; 

   /** 
    * @brief Check if the component is segment offset per NDN naming conventions 
    * @see http://named-data.net/doc/tech-memos/naming-conventions.pdf 
    */ 
   bool 
   isSegmentOffset() const; 

   /** 
    * @brief Check if the component is timestamp per NDN naming conventions 
    * @see http://named-data.net/doc/tech-memos/naming-conventions.pdf 
    */ 
   bool 
   isTimestamp() const; 

   /** 
    * @brief Check if the component is sequence number per NDN naming conventions 
    * @see http://named-data.net/doc/tech-memos/naming-conventions.pdf 
    */ 
   bool 
   isSequenceNumber() const; 

   /** 
    * @brief Check if the component is GenericComponent 
    */ 
   bool 
   isGeneric() const; 

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

Back