Project

General

Profile

Feature #2090

Updated by Junxiao Shi almost 10 years ago

This task is to match `Name::compare` with `std::string::compare` (for partial name comparison): 

 ``` 
 class Name 
 { 
 public: 
   /** \brief indicates "until the end" in getSubName and compare 
    */ 
   public static size_t npos; 

   /** \brief compares [pos1 ,pos1+count1) components in this Name to all components in \p other 
    * 
    *    This is equivalent to this->getSubName(pos1, count1).compare(other); 
    */ 
   

     int 
   compare(size_t compare( size_type pos1, size_t size_type count1, 
                  const Name& other); 

   /** \brief compares [pos1, pos1+count1) components in this Name to [pos2, pos2+count2) components in \p other 
    * 
    *    This is equivalent to this->getSubName(pos1, count1).compare(other.getSubName(pos2, count2)); 
    */ 
   name2 ) const; 
    
     int 
   compare(size_t compare( size_type pos1, size_t size_type count1, 
                  const Name& other, size_t name2, 
                  size_type pos2, size_t size_type count2 = npos); 
 } 
 ``` npos ) const;

Back