28                                    wxString* aResultPath )
 
   30    wxCHECK_MSG( aPathA.IsAbsolute(), 
false,
 
   31                 aPathA.GetPath() + wxS( 
" is not an absolute path." ) );
 
   32    wxCHECK_MSG( aPathB.IsAbsolute(), 
false,
 
   33                 aPathB.GetPath() + wxS( 
" is not an absolute path." ) );
 
   35    if( aPathA.GetPath() == aPathB.GetPath() )
 
   40    if( ( aPathA.GetDirCount() > aPathB.GetDirCount() )
 
   41      || ( aPathA.HasVolume() && !aPathB.HasVolume() )
 
   42      || ( !aPathA.HasVolume() && aPathB.HasVolume() )
 
   43      || ( ( aPathA.HasVolume() && aPathB.HasVolume() )
 
   44         && ( aPathA.GetVolume().CmpNoCase( aPathB.GetVolume() ) != 0 ) ) )
 
   47    wxArrayString aDirs = aPathA.GetDirs();
 
   48    wxArrayString bDirs = aPathB.GetDirs();
 
   52    while( i < aDirs.GetCount() )
 
   54        if( aDirs[i] != bDirs[i] )
 
   62        while( i < bDirs.GetCount() )
 
   64            *aResultPath += bDirs[i] + wxT( 
"/" );
 
 
   74                        const wxString& aProjectPath )
 
   78    wxString   remainingPath;
 
   79    wxString   normalizedFullPath;
 
   84        for( 
const std::pair<const wxString, ENV_VAR_ITEM>& entry : *aEnvVars )
 
   87            if( !wxFileName::DirExists( entry.second.GetValue() )
 
   88                    || !wxFileName::IsDirReadable( entry.second.GetValue() ) )
 
   93            envPath.SetPath( entry.second.GetValue() );
 
   99                int newDepth = envPath.GetDirs().GetCount();
 
  102                if( newDepth > pathDepth )
 
  104                    pathDepth     = newDepth;
 
  105                    varName       = entry.first;
 
  115    if( varName.IsEmpty() && !aProjectPath.IsEmpty()
 
  116        && wxFileName( aProjectPath ).IsAbsolute() && wxFileName( aFilePath ).IsAbsolute() )
 
  118        envPath.SetPath( aProjectPath );
 
  124    if( varName.IsEmpty() )
 
  126        normalizedFullPath = aFilePath.GetFullPath();
 
  130        normalizedFullPath = wxString::Format( 
"${%s}/", varName );
 
  132        if( !remainingPath.IsEmpty() )
 
  133            normalizedFullPath += remainingPath;
 
  135        normalizedFullPath += aFilePath.GetFullName();
 
  138    return normalizedFullPath;
 
 
  199    wxFileName fn( aFileName );
 
  202    wxArrayString pdirs = prj.GetDirs();
 
  203    wxArrayString fdirs = fn.GetDirs();
 
  205    if( fdirs.size() < pdirs.size() )
 
  208    for( 
size_t i = 0; i < pdirs.size(); i++ )
 
  210        if( fdirs[i] != pdirs[i] )
 
  219        for( 
size_t i = pdirs.size(); i < fdirs.size(); i++ )
 
  220            aSubPath->AppendDir( fdirs[i] );
 
 
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
 
wxString ResolveFile(const wxString &aFileName, const ENV_VAR_MAP *aEnvVars, const PROJECT *aProject)
Search the default paths trying to find one with the requested file.