return str::regex_match( name_r, what, filenameRegex );
}
- Capability Capability::guessPackageSpec( const std::string & str_r )
+ Capability Capability::guessPackageSpec( const std::string & str_r, bool & rewrote_r )
{
Capability cap( str_r );
CapDetail detail( cap.detail() );
ResPool pool( ResPool::instance() );
// require name part matching a pool items name (not just provides!)
if ( pool.byIdentBegin( detail.name() ) != pool.byIdentEnd( detail.name() ) )
+ {
+ rewrote_r = true;
return guesscap;
+ }
// try the one but last '-'
if ( pos )
// require name part matching a pool items name (not just provides!)
if ( pool.byIdentBegin( detail.name() ) != pool.byIdentEnd( detail.name() ) )
+ {
+ rewrote_r = true;
return guesscap;
+ }
}
}
}
+
+ rewrote_r = false;
return cap;
}
+ Capability guessPackageSpec( const std::string & str_r )
+ {
+ bool dummy;
+ return guessPackageSpec( str_r, dummy );
+ }
+
/******************************************************************
**
** FUNCTION NAME : operator<<
* result depends on the pools content.
*/
static Capability guessPackageSpec( const std::string & str_r );
+ /** \overload Taking an additional bool indicating whether \c str_r made
+ * a valid \ref Capability (\c true) or the result was was guessed by
+ * rewiting a \c '-' to \c '='. (\c false).
+ */
+ static Capability guessPackageSpec( const std::string & str_r, bool & rewrote_r );
public:
/** Expert backdoor. */