indent
authorMichael Andres <ma@suse.de>
Wed, 16 Jan 2008 12:58:17 +0000 (12:58 +0000)
committerMichael Andres <ma@suse.de>
Wed, 16 Jan 2008 12:58:17 +0000 (12:58 +0000)
zypp/sat/IdString.cc
zypp/sat/IdString.h
zypp/sat/IdStringType.h

index b7adb57..2ddf9de 100644 (file)
@@ -23,61 +23,61 @@ using std::endl;
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
-    // MPL checks for satlib constants we explicity use in
-    // the header file.
-    BOOST_MPL_ASSERT_RELATION( 0, ==, STRID_NULL );
-    BOOST_MPL_ASSERT_RELATION( 1, ==, STRID_EMPTY );
+  // MPL checks for satlib constants we explicity use in
+  // the header file.
+  BOOST_MPL_ASSERT_RELATION( 0, ==, STRID_NULL );
+  BOOST_MPL_ASSERT_RELATION( 1, ==, STRID_EMPTY );
 
-    const IdString IdString::Null ( STRID_NULL );
-    const IdString IdString::Empty( STRID_EMPTY );
+  const IdString IdString::Null ( STRID_NULL );
+  const IdString IdString::Empty( STRID_EMPTY );
 
-    /////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
 
-    IdString::IdString( const char * str_r )
-      : _id( ::str2id( myPool().getPool(), str_r, /*create*/true ) )
-    {}
+  IdString::IdString( const char * str_r )
+  : _id( ::str2id( myPool().getPool(), str_r, /*create*/true ) )
+  {}
 
-    IdString::IdString( const std::string & str_r )
-      : _id( ::str2id( myPool().getPool(), str_r.c_str(), /*create*/true ) )
-    {}
+  IdString::IdString( const std::string & str_r )
+  : _id( ::str2id( myPool().getPool(), str_r.c_str(), /*create*/true ) )
+  {}
 
-    unsigned IdString::size() const
-    { return ::strlen( c_str() ); }
+  unsigned IdString::size() const
+  { return ::strlen( c_str() ); }
 
-    const char * IdString::c_str() const
-    { return _id ? ::id2str( myPool().getPool(), _id ) : ""; }
+  const char * IdString::c_str() const
+  { return _id ? ::id2str( myPool().getPool(), _id ) : ""; }
 
-    int IdString::compare( const IdString & rhs ) const
-    {
-      if ( _id == rhs._id )
-        return 0;
-      // Explicitly handle IdString::Null < ""
-      if ( ! _id )
-        return -1;
-      if ( ! rhs._id )
-        return 1;
-      return ::strcmp( c_str(), rhs.c_str() );
-    }
+  int IdString::compare( const IdString & rhs ) const
+  {
+    if ( _id == rhs._id )
+      return 0;
+    // Explicitly handle IdString::Null < ""
+    if ( ! _id )
+      return -1;
+    if ( ! rhs._id )
+      return 1;
+    return ::strcmp( c_str(), rhs.c_str() );
+  }
 
-    int IdString::compare( const char * rhs ) const
-    {
-      // Explicitly handle IdString::Null == (const char *)0
-      if ( ! _id )
-        return rhs ? -1 : 0;
-      if ( ! rhs )
-        return _id ? 1 : 0;
-      return ::strcmp( c_str(), rhs );
-    }
+  int IdString::compare( const char * rhs ) const
+  {
+    // Explicitly handle IdString::Null == (const char *)0
+    if ( ! _id )
+      return rhs ? -1 : 0;
+    if ( ! rhs )
+      return _id ? 1 : 0;
+    return ::strcmp( c_str(), rhs );
+  }
 
-   /******************************************************************
-    **
-    ** FUNCTION NAME : operator<<
-    ** FUNCTION TYPE : std::ostream &
-    */
-    std::ostream & operator<<( std::ostream & str, const IdString & obj )
-    {
-      return str << obj.c_str();
-    }
+  /******************************************************************
+  **
+  **   FUNCTION NAME : operator<<
+  **   FUNCTION TYPE : std::ostream &
+  */
+  std::ostream & operator<<( std::ostream & str, const IdString & obj )
+  {
+    return str << obj.c_str();
+  }
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
index 6829f45..fd30aaa 100644 (file)
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
-    ///////////////////////////////////////////////////////////////////
-    //
-    // CLASS NAME : IdString
-    //
-    /** Access to the sat-pools string space.
-     *
-     * Construction from string will place a copy of the string in the
-     * string space, if it is not already present.
-     *
-     * While comparison differs between \ref IdString::Null and \ref IdString::Empty
-     * ( \c NULL and \c "" ), both are represented by an empty string \c "".
-    */
-    class IdString: protected sat::detail::PoolMember,
-                    private base::SafeBool<IdString>
-    {
-      public:
-        /** Default ctor, empty string. */
-        IdString() : _id( 1 ) {}
-
-        /** Ctor from id. */
-        explicit IdString( sat::detail::IdType id_r ) : _id( id_r ) {}
-
-        /** Ctor from string. */
-        explicit IdString( const char * str_r );
-
-        /** Ctor from string. */
-        explicit IdString( const std::string & str_r );
-
-      public:
-        /** No or Null string ( Id \c 0 ). */
-        static const IdString Null;
-
-        /** Empty string. */
-        static const IdString Empty;
-
-      public:
-        /** Evaluate in a boolean context <tt>( != \c Null )</tt>. */
-        using base::SafeBool<IdString>::operator bool_type;
-
-        /** Whether the string is empty.
-         * This is true for \ref Null and \ref Empty.
-        */
-        bool empty() const
-        { return( _id == 1 || _id == 0 ); }
-
-        /** The strings size. */
-        unsigned size() const;
-
-      public:
-        /** Conversion to <tt>const char *</tt> */
-        const char * c_str() const;
-
-        /** Conversion to <tt>std::string</tt> */
-        std::string string() const
-        { return c_str(); }
-
-        /** \overload */
-        std::string asString() const
-        { return c_str(); }
-
-      public:
-        /** Fast compare equal. */
-        bool compareEQ( const IdString & rhs ) const
-        { return( _id == rhs.id() ); }
-
-        /** Compare IdString returning <tt>-1,0,1</tt>. */
-        int compare( const IdString & rhs ) const;
-
-        /** \overload */
-        int compare( const char * rhs ) const;
-
-        /** \overload */
-        int compare( const std::string & rhs ) const
-        { return compare( rhs.c_str() ); }
-
-      public:
-        /** Expert backdoor. */
-        sat::detail::IdType id() const
-        { return _id; }
-      private:
-        friend base::SafeBool<IdString>::operator bool_type() const;
-        bool boolTest() const { return _id; }
-      private:
-        sat::detail::IdType _id;
-    };
-    ///////////////////////////////////////////////////////////////////
-
-    /** \relates IdString Stream output */
-    std::ostream & operator<<( std::ostream & str, const IdString & obj );
-
-    /** \relates IdString Equal */
-    inline bool operator==( const IdString & lhs, const IdString & rhs )
-    { return lhs.compareEQ( rhs ); }
-    /** \overload */
-    inline bool operator==( const IdString & lhs, const char * rhs )
-    { return lhs.compare( rhs ) == 0; }
-    /** \overload */
-    inline bool operator==( const IdString & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) == 0; }
-    /** \overload */
-    inline bool operator==( const char * lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) == 0; }
-    /** \overload */
-    inline bool operator==( const std::string & lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) == 0; }
-
-    /** \relates IdString NotEqual */
-    inline bool operator!=( const IdString & lhs, const IdString & rhs )
-    { return ! lhs.compareEQ( rhs ); }
-    /** \overload */
-    inline bool operator!=( const IdString & lhs, const char * rhs )
-    { return lhs.compare( rhs ) != 0; }
-    /** \overload */
-    inline bool operator!=( const IdString & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) != 0; }
-    /** \overload */
-    inline bool operator!=( const char * lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) != 0; }
-    /** \overload */
-    inline bool operator!=( const std::string & lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) != 0; }
-
-    /** \relates IdString Less */
-    inline bool operator<( const IdString & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) < 0; }
-    /** \overload */
-    inline bool operator<( const IdString & lhs, const char * rhs )
-    { return lhs.compare( rhs ) < 0; }
-    /** \overload */
-    inline bool operator<( const IdString & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) < 0; }
-    /** \overload */
-    inline bool operator<( const char * lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) >= 0; }
-    /** \overload */
-    inline bool operator<( const std::string & lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) >= 0; }
-
-    /** \relates IdString LessEqual*/
-    inline bool operator<=( const IdString & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) <= 0; }
-    /** \overload */
-    inline bool operator<=( const IdString & lhs, const char * rhs )
-    { return lhs.compare( rhs ) <= 0; }
-    /** \overload */
-    inline bool operator<=( const IdString & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) <= 0; }
-    /** \overload */
-    inline bool operator<=( const char * lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) > 0; }
-    /** \overload */
-    inline bool operator<=( const std::string & lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) > 0; }
-
-     /** \relates IdString Greater */
-    inline bool operator>( const IdString & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) > 0; }
-    /** \overload */
-    inline bool operator>( const IdString & lhs, const char * rhs )
-    { return lhs.compare( rhs ) > 0; }
-    /** \overload */
-    inline bool operator>( const IdString & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) > 0; }
-    /** \overload */
-    inline bool operator>( const char * lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) <= 0; }
-    /** \overload */
-    inline bool operator>( const std::string & lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) <= 0; }
-
-    /** \relates IdString GreaterEqual */
-    inline bool operator>=( const IdString & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) >= 0; }
-    /** \overload */
-    inline bool operator>=( const IdString & lhs, const char * rhs )
-    { return lhs.compare( rhs ) >= 0; }
-    /** \overload */
-    inline bool operator>=( const IdString & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) >= 0; }
-    /** \overload */
-    inline bool operator>=( const char * lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) < 0; }
-    /** \overload */
-    inline bool operator>=( const std::string & lhs, const IdString & rhs )
-    { return rhs.compare( lhs ) < 0; }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   CLASS NAME : IdString
+  //
+  /** Access to the sat-pools string space.
+   *
+   * Construction from string will place a copy of the string in the
+   * string space, if it is not already present.
+   *
+   * While comparison differs between \ref IdString::Null and \ref IdString::Empty
+   * ( \c NULL and \c "" ), both are represented by an empty string \c "".
+   */
+  class IdString: protected sat::detail::PoolMember,
+  private base::SafeBool<IdString>
+  {
+    public:
+      /** Default ctor, empty string. */
+      IdString() : _id( 1 ) {}
+
+      /** Ctor from id. */
+      explicit IdString( sat::detail::IdType id_r ) : _id( id_r ) {}
+
+      /** Ctor from string. */
+      explicit IdString( const char * str_r );
+
+      /** Ctor from string. */
+      explicit IdString( const std::string & str_r );
+
+    public:
+      /** No or Null string ( Id \c 0 ). */
+      static const IdString Null;
+
+      /** Empty string. */
+      static const IdString Empty;
+
+    public:
+      /** Evaluate in a boolean context <tt>( != \c Null )</tt>. */
+      using base::SafeBool<IdString>::operator bool_type;
+
+      /** Whether the string is empty.
+       * This is true for \ref Null and \ref Empty.
+       */
+      bool empty() const
+      { return( _id == 1 || _id == 0 ); }
+
+      /** The strings size. */
+      unsigned size() const;
+
+    public:
+      /** Conversion to <tt>const char *</tt> */
+      const char * c_str() const;
+
+      /** Conversion to <tt>std::string</tt> */
+      std::string string() const
+      { return c_str(); }
+
+      /** \overload */
+      std::string asString() const
+      { return c_str(); }
+
+    public:
+      /** Fast compare equal. */
+      bool compareEQ( const IdString & rhs ) const
+      { return( _id == rhs.id() ); }
+
+      /** Compare IdString returning <tt>-1,0,1</tt>. */
+      int compare( const IdString & rhs ) const;
+
+      /** \overload */
+      int compare( const char * rhs ) const;
+
+      /** \overload */
+      int compare( const std::string & rhs ) const
+      { return compare( rhs.c_str() ); }
+
+    public:
+      /** Expert backdoor. */
+      sat::detail::IdType id() const
+      { return _id; }
+    private:
+      friend base::SafeBool<IdString>::operator bool_type() const;
+      bool boolTest() const { return _id; }
+    private:
+      sat::detail::IdType _id;
+  };
+  ///////////////////////////////////////////////////////////////////
+
+  /** \relates IdString Stream output */
+  std::ostream & operator<<( std::ostream & str, const IdString & obj );
+
+  /** \relates IdString Equal */
+  inline bool operator==( const IdString & lhs, const IdString & rhs )
+  { return lhs.compareEQ( rhs ); }
+  /** \overload */
+  inline bool operator==( const IdString & lhs, const char * rhs )
+  { return lhs.compare( rhs ) == 0; }
+  /** \overload */
+  inline bool operator==( const IdString & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) == 0; }
+  /** \overload */
+  inline bool operator==( const char * lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) == 0; }
+  /** \overload */
+  inline bool operator==( const std::string & lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) == 0; }
+
+  /** \relates IdString NotEqual */
+  inline bool operator!=( const IdString & lhs, const IdString & rhs )
+  { return ! lhs.compareEQ( rhs ); }
+  /** \overload */
+  inline bool operator!=( const IdString & lhs, const char * rhs )
+  { return lhs.compare( rhs ) != 0; }
+  /** \overload */
+  inline bool operator!=( const IdString & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) != 0; }
+  /** \overload */
+  inline bool operator!=( const char * lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) != 0; }
+  /** \overload */
+  inline bool operator!=( const std::string & lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) != 0; }
+
+  /** \relates IdString Less */
+  inline bool operator<( const IdString & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) < 0; }
+  /** \overload */
+  inline bool operator<( const IdString & lhs, const char * rhs )
+  { return lhs.compare( rhs ) < 0; }
+  /** \overload */
+  inline bool operator<( const IdString & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) < 0; }
+  /** \overload */
+  inline bool operator<( const char * lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) >= 0; }
+  /** \overload */
+  inline bool operator<( const std::string & lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) >= 0; }
+
+  /** \relates IdString LessEqual*/
+  inline bool operator<=( const IdString & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) <= 0; }
+  /** \overload */
+  inline bool operator<=( const IdString & lhs, const char * rhs )
+  { return lhs.compare( rhs ) <= 0; }
+  /** \overload */
+  inline bool operator<=( const IdString & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) <= 0; }
+  /** \overload */
+  inline bool operator<=( const char * lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) > 0; }
+  /** \overload */
+  inline bool operator<=( const std::string & lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) > 0; }
+
+  /** \relates IdString Greater */
+  inline bool operator>( const IdString & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) > 0; }
+  /** \overload */
+  inline bool operator>( const IdString & lhs, const char * rhs )
+  { return lhs.compare( rhs ) > 0; }
+  /** \overload */
+  inline bool operator>( const IdString & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) > 0; }
+  /** \overload */
+  inline bool operator>( const char * lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) <= 0; }
+  /** \overload */
+  inline bool operator>( const std::string & lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) <= 0; }
+
+  /** \relates IdString GreaterEqual */
+  inline bool operator>=( const IdString & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) >= 0; }
+  /** \overload */
+  inline bool operator>=( const IdString & lhs, const char * rhs )
+  { return lhs.compare( rhs ) >= 0; }
+  /** \overload */
+  inline bool operator>=( const IdString & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) >= 0; }
+  /** \overload */
+  inline bool operator>=( const char * lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) < 0; }
+  /** \overload */
+  inline bool operator>=( const std::string & lhs, const IdString & rhs )
+  { return rhs.compare( lhs ) < 0; }
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
index 508e295..72c70d6 100644 (file)
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
-    ///////////////////////////////////////////////////////////////////
-    //
-    // CLASS NAME : IdStringType<Derived>
-    //
-    /** Base class for creating \ref IdString based types.
-     *
-     * Just by deriving from \ref IdStringType a class provides all
-     * the operations an \ref IdString does. (incl. conversion to string types,
-     * comparison of string types and stream output).
-     *
-     * To disable any comparison, declare (but do not define) \ref _doCompare
-     * in your class.
-     * \code
-     * class NoCompare : public IdStringType<NoCompare>
-     * {
-     *   private:
-      *   static int _doCompare( const char * lhs,  const char * rhs );
-     *
-     * };
-     * \endcode
-     *
-     * If you need a different than the default lexicographical
-     * order, write your own \ref _doCompare.
-     *
-     * \code
-     *    // uses default lexicographical order
-     *    class CaseCmp : public IdStringType<CaseCmp>
-     *    {
-     *      public:
-     *        CaseCmp() {}
-     *        explicit CaseCmp( const char * cstr_r ) : _str( cstr_r )  {}
-     *      private:
-     *        friend class IdStringType<CaseCmp>;
-     *        IdString _str;
-     *    };
-     *
-     *    // uses case insensitive comparison order
-     *    class NoCaseCmp : public IdStringType<NoCaseCmp>
-     *    {
-     *      public:
-     *        NoCaseCmp() {}
-     *        explicit NoCaseCmp( const char * cstr_r ) : _str( cstr_r )  {}
-     *      private:
-     *        static int _doCompare( const char * lhs,  const char * rhs )
-     *        {
-     *          if ( lhs == rhs ) return 0;
-     *          if ( lhs && rhs ) return ::strcasecmp( lhs, rhs );
-     *          return( lhs ? 1 : -1 );
-     *        }
-     *      private:
-     *        friend class IdStringType<NoCaseCmp>;
-     *        IdString _str;
-     *    };
-     *
-     *    CaseCmp   ca( "a" );
-     *    NoCaseCmp na( "a" );
-     *    DBG << "ca == a ? " << (ca == "a") << endl;   // ca == a ? 1
-     *    DBG << "ca == A ? " << (ca == "A") << endl;   // ca == A ? 0
-     *    DBG << "na == a ? " << (na == "a") << endl;   // na == a ? 1
-     *    DBG << "na == A ? " << (na == "A") << endl;   // na == A ? 1
-     * \endcode
-     * \ingroup g_CRTP
-    */
-    template <class Derived>
-    class IdStringType : private base::SafeBool<Derived>
-    {
-      typedef typename base::SafeBool<Derived>::bool_type bool_type;
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   CLASS NAME : IdStringType<Derived>
+  //
+  /** Base class for creating \ref IdString based types.
+   *
+   * Just by deriving from \ref IdStringType a class provides all
+   * the operations an \ref IdString does. (incl. conversion to string types,
+   * comparison of string types and stream output).
+   *
+   * To disable any comparison, declare (but do not define) \ref _doCompare
+   * in your class.
+   * \code
+   * class NoCompare : public IdStringType<NoCompare>
+   * {
+   *   private:
+   *   static int _doCompare( const char * lhs,  const char * rhs );
+   *
+   * };
+   * \endcode
+   *
+   * If you need a different than the default lexicographical
+   * order, write your own \ref _doCompare.
+   *
+   * \code
+   *    // uses default lexicographical order
+   *    class CaseCmp : public IdStringType<CaseCmp>
+   *    {
+   *      public:
+   *        CaseCmp() {}
+   *        explicit CaseCmp( const char * cstr_r ) : _str( cstr_r )  {}
+   *      private:
+   *        friend class IdStringType<CaseCmp>;
+   *        IdString _str;
+   *    };
+   *
+   *    // uses case insensitive comparison order
+   *    class NoCaseCmp : public IdStringType<NoCaseCmp>
+   *    {
+   *      public:
+   *        NoCaseCmp() {}
+   *        explicit NoCaseCmp( const char * cstr_r ) : _str( cstr_r )  {}
+   *      private:
+   *        static int _doCompare( const char * lhs,  const char * rhs )
+   *        {
+   *          if ( lhs == rhs ) return 0;
+   *          if ( lhs && rhs ) return ::strcasecmp( lhs, rhs );
+   *          return( lhs ? 1 : -1 );
+   *        }
+   *      private:
+   *        friend class IdStringType<NoCaseCmp>;
+   *        IdString _str;
+   *    };
+   *
+   *    CaseCmp   ca( "a" );
+   *    NoCaseCmp na( "a" );
+   *    DBG << "ca == a ? " << (ca == "a") << endl;   // ca == a ? 1
+   *    DBG << "ca == A ? " << (ca == "A") << endl;   // ca == A ? 0
+   *    DBG << "na == a ? " << (na == "a") << endl;   // na == a ? 1
+   *    DBG << "na == A ? " << (na == "A") << endl;   // na == A ? 1
+   * \endcode
+   * \ingroup g_CRTP
+   */
+  template <class Derived>
+  class IdStringType : private base::SafeBool<Derived>
+  {
+    typedef typename base::SafeBool<Derived>::bool_type bool_type;
 
-      protected:
-        IdStringType() {}
-        IdStringType(const IdStringType &) {}
-        void operator=(const IdStringType &) {}
+    protected:
+      IdStringType() {}
+      IdStringType(const IdStringType &) {}
+      void operator=(const IdStringType &) {}
 
-      private:
-        const Derived & self() const { return *static_cast<const Derived*>( this ); }
+    private:
+      const Derived & self() const { return *static_cast<const Derived*>( this ); }
 
-      public:
-        const IdString & idStr()    const { return self()._str; }
+    public:
+      const IdString & idStr()    const { return self()._str; }
 
-        bool          empty()       const { return idStr().empty(); }
-        unsigned      size()        const { return idStr().size(); }
-        const char *  c_str()       const { return idStr().c_str(); }
-        std::string   string()      const { return idStr().string(); }
-        std::string   asString()    const { return idStr().asString(); }
+      bool          empty()       const { return idStr().empty(); }
+      unsigned      size()        const { return idStr().size(); }
+      const char *  c_str()       const { return idStr().c_str(); }
+      std::string   string()      const { return idStr().string(); }
+      std::string   asString()    const { return idStr().asString(); }
 
-      public:
-        /** Evaluate in a boolean context <tt>( ! empty() )</tt>. */
-        using base::SafeBool<Derived>::operator bool_type;
+    public:
+      /** Evaluate in a boolean context <tt>( ! empty() )</tt>. */
+      using base::SafeBool<Derived>::operator bool_type;
 
-      public:
-        static int compare( const Derived & lhs,    const Derived & rhs )      { return compare( lhs.idStr(), rhs.idStr() ); }
-        static int compare( const Derived & lhs,    const IdString & rhs )     { return compare( lhs.idStr(), rhs ); }
-        static int compare( const Derived & lhs,    const std::string & rhs )  { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
-        static int compare( const Derived & lhs,    const char * rhs )         { return Derived::_doCompare( lhs.c_str(), rhs );}
+    public:
+      static int compare( const Derived & lhs,    const Derived & rhs )      { return compare( lhs.idStr(), rhs.idStr() ); }
+      static int compare( const Derived & lhs,    const IdString & rhs )     { return compare( lhs.idStr(), rhs ); }
+      static int compare( const Derived & lhs,    const std::string & rhs )  { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
+      static int compare( const Derived & lhs,    const char * rhs )         { return Derived::_doCompare( lhs.c_str(), rhs );}
 
-        static int compare( const IdString & lhs,   const Derived & rhs )      { return compare( lhs, rhs.idStr() ); }
-        static int compare( const IdString & lhs,   const IdString & rhs )     { return lhs.compareEQ( rhs ) ? 0 :
-                                                                                        Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
-        static int compare( const IdString & lhs,   const std::string & rhs )  { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
-        static int compare( const IdString & lhs,   const char * rhs )         { return Derived::_doCompare( lhs.c_str(), rhs ); }
+      static int compare( const IdString & lhs,   const Derived & rhs )      { return compare( lhs, rhs.idStr() ); }
+      static int compare( const IdString & lhs,   const IdString & rhs )     { return lhs.compareEQ( rhs ) ? 0 :
+                                                                                      Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
+      static int compare( const IdString & lhs,   const std::string & rhs )  { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
+      static int compare( const IdString & lhs,   const char * rhs )         { return Derived::_doCompare( lhs.c_str(), rhs ); }
 
-        static int compare( const std::string & lhs, const Derived & rhs )     { return Derived::_doCompare( lhs.c_str(), rhs.c_str() );}
-        static int compare( const std::string & lhs, const IdString & rhs )    { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
-        static int compare( const std::string & lhs, const std::string & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
-        static int compare( const std::string & lhs, const char * rhs )        { return Derived::_doCompare( lhs.c_str(), rhs ); }
+      static int compare( const std::string & lhs, const Derived & rhs )     { return Derived::_doCompare( lhs.c_str(), rhs.c_str() );}
+      static int compare( const std::string & lhs, const IdString & rhs )    { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
+      static int compare( const std::string & lhs, const std::string & rhs ) { return Derived::_doCompare( lhs.c_str(), rhs.c_str() ); }
+      static int compare( const std::string & lhs, const char * rhs )        { return Derived::_doCompare( lhs.c_str(), rhs ); }
 
-        static int compare( const char * lhs,        const Derived & rhs )     { return Derived::_doCompare( lhs, rhs.c_str() );}
-        static int compare( const char * lhs,        const IdString & rhs )    { return Derived::_doCompare( lhs, rhs.c_str() ); }
-        static int compare( const char * lhs,        const std::string & rhs ) { return Derived::_doCompare( lhs, rhs.c_str() ); }
-        static int compare( const char * lhs,        const char * rhs )        { return Derived::_doCompare( lhs, rhs ); }
+      static int compare( const char * lhs,        const Derived & rhs )     { return Derived::_doCompare( lhs, rhs.c_str() );}
+      static int compare( const char * lhs,        const IdString & rhs )    { return Derived::_doCompare( lhs, rhs.c_str() ); }
+      static int compare( const char * lhs,        const std::string & rhs ) { return Derived::_doCompare( lhs, rhs.c_str() ); }
+      static int compare( const char * lhs,        const char * rhs )        { return Derived::_doCompare( lhs, rhs ); }
 
-      public:
-        int compare( const Derived & rhs )      const { return compare( idStr(), rhs.idStr() ); }
-        int compare( const IdStringType & rhs ) const { return compare( idStr(), rhs.idStr() ); }
-        int compare( const IdString & rhs )     const { return compare( idStr(), rhs ); }
-        int compare( const std::string & rhs )  const { return Derived::_doCompare( c_str(), rhs.c_str() ); }
-        int compare( const char * rhs )         const { return Derived::_doCompare( c_str(), rhs ); }
+    public:
+      int compare( const Derived & rhs )      const { return compare( idStr(), rhs.idStr() ); }
+      int compare( const IdStringType & rhs ) const { return compare( idStr(), rhs.idStr() ); }
+      int compare( const IdString & rhs )     const { return compare( idStr(), rhs ); }
+      int compare( const std::string & rhs )  const { return Derived::_doCompare( c_str(), rhs.c_str() ); }
+      int compare( const char * rhs )         const { return Derived::_doCompare( c_str(), rhs ); }
 
-      private:
-        static int _doCompare( const char * lhs,  const char * rhs )
-        {
-          if ( lhs == rhs ) return 0;
-          if ( lhs && rhs ) return ::strcmp( lhs, rhs );
-          return( lhs ? 1 : -1 );
-        }
+    private:
+      static int _doCompare( const char * lhs,  const char * rhs )
+      {
+        if ( lhs == rhs ) return 0;
+        if ( lhs && rhs ) return ::strcmp( lhs, rhs );
+        return( lhs ? 1 : -1 );
+      }
 
-      private:
+    private:
 
-        friend base::SafeBool<Derived>::operator bool_type() const;
-        bool boolTest() const { return ! empty(); }
-    };
-    ///////////////////////////////////////////////////////////////////
+      friend base::SafeBool<Derived>::operator bool_type() const;
+      bool boolTest() const { return ! empty(); }
+  };
+  ///////////////////////////////////////////////////////////////////
 
-    /** \relates IdStringType Stream output */
-    template <class Derived>
-    inline std::ostream & operator<<( std::ostream & str, const IdStringType<Derived> & obj )
-    { return str << obj.c_str(); }
+  /** \relates IdStringType Stream output */
+  template <class Derived>
+  inline std::ostream & operator<<( std::ostream & str, const IdStringType<Derived> & obj )
+  { return str << obj.c_str(); }
 
-    /** \relates IdStringType Equal */
-    template <class Derived>
-    inline bool operator==( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
-    { return lhs.idStr().compareEQ( rhs.idStr() ); }
-    /** \overload */
-    template <class Derived>
-    inline bool operator==( const IdStringType<Derived> & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) == 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator==( const IdStringType<Derived> & lhs, const char * rhs )
-    { return lhs.compare( rhs ) == 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator==( const IdStringType<Derived> & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) == 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator==( const IdString & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) == 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator==( const char * lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) == 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator==( const std::string & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) == 0; }
+  /** \relates IdStringType Equal */
+  template <class Derived>
+  inline bool operator==( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
+  { return lhs.idStr().compareEQ( rhs.idStr() ); }
+  /** \overload */
+  template <class Derived>
+  inline bool operator==( const IdStringType<Derived> & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) == 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator==( const IdStringType<Derived> & lhs, const char * rhs )
+  { return lhs.compare( rhs ) == 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator==( const IdStringType<Derived> & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) == 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator==( const IdString & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) == 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator==( const char * lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) == 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator==( const std::string & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) == 0; }
 
-    /** \relates IdStringType NotEqual */
-    template <class Derived>
-    inline bool operator!=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
-    { return lhs.idStr().compareEQ( rhs.idStr() ); }
-    /** \overload */
-    template <class Derived>
-    inline bool operator!=( const IdStringType<Derived> & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) != 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator!=( const IdStringType<Derived> & lhs, const char * rhs )
-    { return lhs.compare( rhs ) != 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator!=( const IdStringType<Derived> & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) != 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator!=( const IdString & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) != 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator!=( const char * lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) != 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator!=( const std::string & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) != 0; }
+  /** \relates IdStringType NotEqual */
+  template <class Derived>
+  inline bool operator!=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
+  { return lhs.idStr().compareEQ( rhs.idStr() ); }
+  /** \overload */
+  template <class Derived>
+  inline bool operator!=( const IdStringType<Derived> & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) != 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator!=( const IdStringType<Derived> & lhs, const char * rhs )
+  { return lhs.compare( rhs ) != 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator!=( const IdStringType<Derived> & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) != 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator!=( const IdString & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) != 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator!=( const char * lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) != 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator!=( const std::string & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) != 0; }
 
-    /** \relates IdStringType Less */
-    template <class Derived>
-    inline bool operator<( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
-    { return lhs.compare( rhs ) < 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<( const IdStringType<Derived> & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) < 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<( const IdStringType<Derived> & lhs, const char * rhs )
-    { return lhs.compare( rhs ) < 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<( const IdStringType<Derived> & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) < 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<( const IdString & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) >= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<( const char * lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) >= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<( const std::string & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) >= 0; }
+  /** \relates IdStringType Less */
+  template <class Derived>
+  inline bool operator<( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
+  { return lhs.compare( rhs ) < 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<( const IdStringType<Derived> & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) < 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<( const IdStringType<Derived> & lhs, const char * rhs )
+  { return lhs.compare( rhs ) < 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<( const IdStringType<Derived> & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) < 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<( const IdString & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) >= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<( const char * lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) >= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<( const std::string & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) >= 0; }
 
-    /** \relates IdStringType LessEqual */
-    template <class Derived>
-    inline bool operator<=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
-    { return lhs.compare( rhs ) <= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<=( const IdStringType<Derived> & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) <= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<=( const IdStringType<Derived> & lhs, const char * rhs )
-    { return lhs.compare( rhs ) <= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<=( const IdStringType<Derived> & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) <= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<=( const IdString & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) > 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<=( const char * lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) > 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator<=( const std::string & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) > 0; }
+  /** \relates IdStringType LessEqual */
+  template <class Derived>
+  inline bool operator<=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
+  { return lhs.compare( rhs ) <= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<=( const IdStringType<Derived> & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) <= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<=( const IdStringType<Derived> & lhs, const char * rhs )
+  { return lhs.compare( rhs ) <= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<=( const IdStringType<Derived> & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) <= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<=( const IdString & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) > 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<=( const char * lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) > 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator<=( const std::string & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) > 0; }
 
-    /** \relates IdStringType Greater */
-    template <class Derived>
-    inline bool operator>( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
-    { return lhs.compare( rhs ) > 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>( const IdStringType<Derived> & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) > 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>( const IdStringType<Derived> & lhs, const char * rhs )
-    { return lhs.compare( rhs ) > 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>( const IdStringType<Derived> & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) > 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>( const IdString & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) <= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>( const char * lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) <= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>( const std::string & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) <= 0; }
+  /** \relates IdStringType Greater */
+  template <class Derived>
+  inline bool operator>( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
+  { return lhs.compare( rhs ) > 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>( const IdStringType<Derived> & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) > 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>( const IdStringType<Derived> & lhs, const char * rhs )
+  { return lhs.compare( rhs ) > 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>( const IdStringType<Derived> & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) > 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>( const IdString & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) <= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>( const char * lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) <= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>( const std::string & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) <= 0; }
 
-    /** \relates IdStringType GreaterEqual */
-    template <class Derived>
-    inline bool operator>=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
-    { return lhs.compare( rhs ) >= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>=( const IdStringType<Derived> & lhs, const IdString & rhs )
-    { return lhs.compare( rhs ) >= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>=( const IdStringType<Derived> & lhs, const char * rhs )
-    { return lhs.compare( rhs ) >= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>=( const IdStringType<Derived> & lhs, const std::string & rhs )
-    { return lhs.compare( rhs ) >= 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>=( const IdString & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) < 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>=( const char * lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) < 0; }
-    /** \overload */
-    template <class Derived>
-    inline bool operator>=( const std::string & lhs, const IdStringType<Derived> & rhs )
-    { return rhs.compare( lhs ) < 0; }
+  /** \relates IdStringType GreaterEqual */
+  template <class Derived>
+  inline bool operator>=( const IdStringType<Derived> & lhs, const IdStringType<Derived> & rhs )
+  { return lhs.compare( rhs ) >= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>=( const IdStringType<Derived> & lhs, const IdString & rhs )
+  { return lhs.compare( rhs ) >= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>=( const IdStringType<Derived> & lhs, const char * rhs )
+  { return lhs.compare( rhs ) >= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>=( const IdStringType<Derived> & lhs, const std::string & rhs )
+  { return lhs.compare( rhs ) >= 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>=( const IdString & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) < 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>=( const char * lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) < 0; }
+  /** \overload */
+  template <class Derived>
+  inline bool operator>=( const std::string & lhs, const IdStringType<Derived> & rhs )
+  { return rhs.compare( lhs ) < 0; }
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp