Ejemplo n.º 1
0
void PHPSourceFile::ReadImplements(wxArrayString& impls)
{
    wxString type;
    phpLexerToken token;
    while(NextToken(token)) {
        switch(token.type) {
        case kPHP_T_IDENTIFIER:
        case kPHP_T_NS_SEPARATOR:
            type << token.text;
            break;
        case ',':
            // More to come
            if(!type.IsEmpty()) {
                wxString fullyQualifiedType = MakeIdentifierAbsolute(type);
                if(impls.Index(fullyQualifiedType) == wxNOT_FOUND) {
                    impls.Add(fullyQualifiedType);
                }
                type.clear();
            }
            break;
        default:
            // unexpected token
            if(!type.IsEmpty()) {
                wxString fullyQualifiedType = MakeIdentifierAbsolute(type);
                if(impls.Index(fullyQualifiedType) == wxNOT_FOUND) {
                    impls.Add(fullyQualifiedType);
                }
                type.clear();
            }
            UngetToken(token);
            return;
        }
    }
}
Ejemplo n.º 2
0
/**
* @brief Construye y muestra una ventana para seleccionar multiples opciones de una lista de posibles
*
* Recibe una lista de posibles opciones y un cuadro de texto, arma una ventana 
* con una lista de checks para las opciones, marca las que estaban presentes
* en el cuadro de texto, y si el usuario presiona aceptar actualiza el contenido
* del cuadro de texto. La ventana se ejecuta directamente en este constructor.
*
* @param parent         ventana padre, para hacerlo modal
* @param title          titulo de la ventana 
* @param message        texto para mostrar sobre la lista de checks
* @param text           control de texto de donde tomar las opciones seleccionadas y donde guardar el resultado
* @param options_array  lista de opciones posibles
* @param comma_splits   indica si la coma separa opciones en el cuadro de texto, para pasar a mxUtils::Split
**/
mxMultipleChoiceEditor::mxMultipleChoiceEditor(wxWindow *parent, wxString title, wxString message, wxTextCtrl *text, wxArrayString &options_array, bool comma_splits) {
	if (last_multiple_choice_editor) delete last_multiple_choice_editor;
	last_multiple_choice_editor=this;
	
	wxArrayString splitted_array;
	wxArrayInt selection;
	mxUT::Split(text->GetValue(),splitted_array,comma_splits,true);
	options_array.Sort();
	int p=options_array.Index("all");
	if (p!=wxNOT_FOUND) {
		for (unsigned int i=0;i<splitted_array.GetCount();i++)
			selection.Add(p);
	} else {
		for (unsigned int i=0;i<splitted_array.GetCount();i++) {
			p=options_array.Index(splitted_array[i]);
			if (p!=wxNOT_FOUND) selection.Add(p);
		}
	}
	if (wxGetMultipleChoices(selection,message,title,options_array,parent)>=0) {
		wxString res;
		if (selection.GetCount()) {
			if (options_array[selection[0]].Contains(wxChar(' '))) 
				res=wxString("\"")<<options_array[selection[0]]<<"\"";
			else
				res=options_array[selection[0]];
			for (unsigned int i=1;i<selection.GetCount();i++) {
				if (options_array[selection[i]].Contains(wxChar(' '))) 
					res<<" \""<<options_array[selection[i]]<<"\"";
				else
					res<<" "<<options_array[selection[i]];
			}
		}
		text->SetValue(res);
	}
}
Ejemplo n.º 3
0
bool PHPSourceFile::ReadCommaSeparatedIdentifiers(int delim, wxArrayString& list)
{
    phpLexerToken token;
    wxString temp;
    while(NextToken(token)) {
        if(token.IsAnyComment()) continue;
        if(token.type == delim) {
            if(!temp.IsEmpty() && list.Index(temp) == wxNOT_FOUND) {
                list.Add(MakeIdentifierAbsolute(temp));
            }
            UngetToken(token);
            return true;
        }

        switch(token.type) {
        case ',':
            if(list.Index(temp) == wxNOT_FOUND) {
                list.Add(MakeIdentifierAbsolute(temp));
            }
            temp.clear();
            break;
        default:
            temp << token.text;
            break;
        }
    }
    return false;
}
Ejemplo n.º 4
0
void ExportMultiple::MakeNameUnique(wxArrayString &otherNames, wxString &newName)
{
   if (otherNames.Index(newName, false) >= 0) {
      int i=2;
      wxString orig = newName;
      do {
         newName.Printf(wxT("%s-%d"), orig.c_str(), i);
         i++;
      } while (otherNames.Index(newName, false) >= 0);
   }
   otherNames.Add(newName);
}
Ejemplo n.º 5
0
// originally an ExportMultiple method. Append suffix if newName appears in otherNames.
void FileNames::MakeNameUnique(wxArrayString &otherNames, wxFileName &newName)
{
   if (otherNames.Index(newName.GetFullName(), false) >= 0) {
      int i=2;
      wxString orig = newName.GetName();
      do {
         newName.SetName(wxString::Format(wxT("%s-%d"), orig.c_str(), i));
         i++;
      } while (otherNames.Index(newName.GetFullName(), false) >= 0);
   }
   otherNames.Add(newName.GetFullName());
}
Ejemplo n.º 6
0
// find all files mentioned in structure, e.g. <bitmap>filename</bitmap>
void wxcXmlResourceCmp::FindFilesInXML(wxXmlNode* node, wxArrayString& flist, const wxString& inputPath)
{
    // Is 'node' XML node element?
    if(node == NULL) return;
    if(node->GetType() != wxXML_ELEMENT_NODE) return;

    bool containsFilename = NodeContainsFilename(node);

    wxXmlNode* n = node->GetChildren();
    while(n) {
        if(containsFilename && (n->GetType() == wxXML_TEXT_NODE || n->GetType() == wxXML_CDATA_SECTION_NODE)) {
            wxString fullname;
            if(wxIsAbsolutePath(n->GetContent()) || inputPath.empty())
                fullname = n->GetContent();
            else
                fullname = inputPath + wxFILE_SEP_PATH + n->GetContent();

            wxString filename = GetInternalFileName(n->GetContent(), flist);
            n->SetContent(filename);

            if(flist.Index(filename) == wxNOT_FOUND) flist.Add(filename);

            wxFileInputStream sin(fullname);
            wxFileOutputStream sout(m_outputPath + wxFILE_SEP_PATH + filename);
            sin.Read(sout); // copy the stream
        }

        // subnodes:
        if(n->GetType() == wxXML_ELEMENT_NODE) FindFilesInXML(n, flist, inputPath);

        n = n->GetNext();
    }
}
Ejemplo n.º 7
0
void main_listctrl::refresh_rows( wxArrayString& channel_sections )
{  
    size_t      number_of_sections           = channel_sections.GetCount();
    wxString    channel_section;  
    long        row_number = -1;  // '-1' needed to include the first selected row.                                 

    if ( number_of_sections == 0 ) 
    {
        return;
    }     
        
    for ( ;; ) 
    {
        row_number = GetNextItem( row_number, wxLIST_NEXT_ALL );
        
        if ( row_number == -1 )
        {
            break; 
        }
        
        channel_section = get_row_channel_section( row_number );
        
        // Only proceed if the current channel section was in our array
        if ( channel_sections.Index( channel_section ) != wxNOT_FOUND )
        {                
            refresh_row( row_number );
        }    
    }
}
Ejemplo n.º 8
0
size_t SCH_SCREENS::GetLibNicknames( wxArrayString& aLibNicknames )
{
    SCH_COMPONENT* symbol;
    SCH_ITEM* item;
    SCH_ITEM* nextItem;
    SCH_SCREEN* screen;
    wxString nickname;

    for( screen = GetFirst(); screen; screen = GetNext() )
    {
        for( item = screen->GetDrawItems(); item; item = nextItem )
        {
            nextItem = item->Next();

            if( item->Type() != SCH_COMPONENT_T )
                continue;

            symbol = dynamic_cast< SCH_COMPONENT* >( item );
            wxASSERT( symbol );

            nickname = symbol->GetLibId().GetLibNickname();

            if( !nickname.empty() && ( aLibNicknames.Index( nickname ) == wxNOT_FOUND ) )
                aLibNicknames.Add( nickname );;
        }
    }

    return aLibNicknames.GetCount();
}
Ejemplo n.º 9
0
wxString wxSystemOptions::GetOption(const wxString& name)
{
    wxString val;

    int idx = gs_optionNames.Index(name, false);
    if ( idx != wxNOT_FOUND )
    {
        val = gs_optionValues[idx];
    }
    else // not set explicitly
    {
        // look in the environment: first for a variable named "wx_appname_name"
        // which can be set to affect the behaviour or just this application
        // and then for "wx_name" which can be set to change the option globally
        wxString var(name);
        var.Replace(wxT("."), wxT("_"));  // '.'s not allowed in env var names
        var.Replace(wxT("-"), wxT("_"));  // and neither are '-'s

        wxString appname;
        if ( wxTheApp )
            appname = wxTheApp->GetAppName();

        if ( !appname.empty() )
            val = wxGetenv(wxT("wx_") + appname + wxT('_') + var);

        if ( val.empty() )
            val = wxGetenv(wxT("wx_") + var);
    }

    return val;
}
bool ProjectOptionsManipulator::HasOption(const wxArrayString& opt_array, const wxString& opt, wxString& full_opt)
{
  switch ( m_Dlg->GetSearchOption() )
  {
    case (ProjectOptionsManipulatorDlg::eContains):
    {
      for (size_t i=0; i<opt_array.Count(); ++i)
      {
        if ( opt_array.Item(i).Contains(opt) )
        {
          full_opt = opt_array.Item(i);
          return true;
        }
      }
    }
    break;

    case (ProjectOptionsManipulatorDlg::eEquals): // fall through
    default:
    {
      int idx = opt_array.Index(opt);
      if (idx!=wxNOT_FOUND)
      {
        full_opt = opt_array.Item(idx);
        return true;
      }
    }
    break;
  }

  return false;
}
Ejemplo n.º 11
0
GameDatabaseListView& GameDatabaseListView::AddGame( const wxString& serial )
{
	if (m_GamesInView.Index( serial, false ) != wxNOT_FOUND) return *this;
	m_GamesInView.Add( serial );
	
	return *this;
}
Ejemplo n.º 12
0
void AddTypeToPredefined( wxListBox *WxListBoxAssociated,
						  wxListBox *WxListBoxPredefined,
						  const wxArrayString &as )
{
	int idx = 0;
	const int count = int( as.Count() );
	wxString type;

	while( idx < count )
	{
		type = as[idx];
		int n = WxListBoxAssociated->FindString( type );

		if( n != wxNOT_FOUND ) { WxListBoxAssociated->Delete( n ); }

		n = WxListBoxPredefined->FindString( type );

		if( n == wxNOT_FOUND ) { WxListBoxPredefined->Append( type ); }

		n = as_remove.Index( type );

		if( n == wxNOT_FOUND ) { as_remove.Add( type ); }

		++idx;
	}
}
Ejemplo n.º 13
0
void PHPCodeGenerator::GetAddToolbarCode( PObjectInfo info, PObjectBase obj, wxArrayString& codelines )
{
	wxString _template;
	PCodeInfo code_info = info->GetCodeInfo( wxT( "PHP" ) );

	if ( !code_info )
		return;

	_template = code_info->GetTemplate( wxT( "toolbar_add" ) );

	if ( !_template.empty() )
	{
		PHPTemplateParser parser( obj, _template, m_i18n, m_useRelativePath, m_basePath );
		wxString code = parser.ParseTemplate();
		if ( !code.empty() )
		{
			if( codelines.Index( code ) == wxNOT_FOUND ) codelines.Add( code );
		}
	}

	// Proceeding recursively with the base classes
	for ( unsigned int i = 0; i < info->GetBaseClassCount(); i++ )
	{
		PObjectInfo base_info = info->GetBaseClass( i );
		GetAddToolbarCode( base_info, obj, codelines );
	}
}
Ejemplo n.º 14
0
void DebuggerTreeListCtrlBase::DoRefreshItemRecursively(IDebugger *dbgr, const wxTreeItemId &item, wxArrayString &itemsToRefresh)
{
    if(itemsToRefresh.IsEmpty())
        return;

    wxTreeItemIdValue cookieOne;
    wxTreeItemId exprItem = m_listTable->GetFirstChild(item, cookieOne);
    while( exprItem.IsOk() ) {

        DbgTreeItemData* data = static_cast<DbgTreeItemData*>(m_listTable->GetItemData(exprItem));
        if(data) {
            int where = itemsToRefresh.Index(data->_gdbId);
            if(where != wxNOT_FOUND) {
                dbgr->EvaluateVariableObject(data->_gdbId, m_DBG_USERR);
                m_gdbIdToTreeId[data->_gdbId] = exprItem;
                itemsToRefresh.RemoveAt((size_t)where);
            }
        }

        if(m_listTable->HasChildren(exprItem)) {
            DoRefreshItemRecursively(dbgr, exprItem, itemsToRefresh);
        }
        exprItem = m_listTable->GetNextChild(item, cookieOne);
    }
}
Ejemplo n.º 15
0
void CommandManager::GetCategories(wxArrayString &cats)
{
   cats.Clear();

   size_t cnt = mCommandList.GetCount();

   for (size_t i = 0; i < cnt; i++) {
      wxString cat = mCommandList[i]->labelTop;
      if (cats.Index(cat) == wxNOT_FOUND) {
         cats.Add(cat);
      }
   }
#if 0
   mCommandList.GetCount(); i++) {
      if (includeMultis || !mCommandList[i]->multi)
         names.Add(mCommandList[i]->name);
   }

   AudacityProject *p = GetActiveProject();
   if (p == NULL) {
      return;
   }

   wxMenuBar *bar = p->GetMenuBar();
   size_t cnt = bar->GetMenuCount();
   for (size_t i = 0; i < cnt; i++) {
      cats.Add(bar->GetMenuLabelText(i));
   }

   cats.Add(COMMAND);
#endif
}
Ejemplo n.º 16
0
wxString wxSystemOptions::GetOption(const wxString& name)
{
    int idx = gs_optionNames.Index(name, false);
    if (idx == wxNOT_FOUND)
        return wxEmptyString;
    else
        return gs_optionValues[idx];
}
Ejemplo n.º 17
0
/// String-to-Index
int ShuttleGuiBase::TranslateToIndex( const wxString &Value, const wxArrayString &Choices )
{
   int n = Choices.Index( Value );
   if( n== wxNOT_FOUND )
      n=miNoMatchSelector;
   miNoMatchSelector = 0;
   return n;
}
Ejemplo n.º 18
0
bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf,
                                    const LPTEXTMETRIC tm) const
{
    if ( m_enumEncodings )
    {
        // is this a new charset?
        int cs = lf->lfCharSet;
        if ( m_charsets.Index(cs) == wxNOT_FOUND )
        {
            wxConstCast(this, wxFontEnumeratorHelper)->m_charsets.Add(cs);

            wxFontEncoding enc = wxGetFontEncFromCharSet(cs);
            return m_fontEnum->OnFontEncoding(lf->lfFaceName,
                                              wxFontMapper::GetEncodingName(enc));
        }
        else
        {
            // continue enumeration
            return true;
        }
    }

    if ( m_fixedOnly )
    {
        // check that it's a fixed pitch font (there is *no* error here, the
        // flag name is misleading!)
        if ( tm->tmPitchAndFamily & TMPF_FIXED_PITCH )
        {
            // not a fixed pitch font
            return true;
        }
    }

    if ( m_charset != DEFAULT_CHARSET )
    {
        // check that we have the right encoding
        if ( lf->lfCharSet != m_charset )
        {
            return true;
        }
    }
    else // enumerating fonts in all charsets
    {
        // we can get the same facename twice or more in this case because it
        // may exist in several charsets but we only want to return one copy of
        // it (note that this can't happen for m_charset != DEFAULT_CHARSET)
        if ( m_facenames.Index(lf->lfFaceName) != wxNOT_FOUND )
        {
            // continue enumeration
            return true;
        }

        wxConstCast(this, wxFontEnumeratorHelper)->
            m_facenames.Add(lf->lfFaceName);
    }

    return m_fontEnum->OnFacename(lf->lfFaceName);
}
Ejemplo n.º 19
0
wxString wxcXmlResourceCmp::GetInternalFileName(const wxString& name, const wxArrayString& flist)
{
    wxString name2 = name;
    name2.Replace(wxT(":"), wxT("_"));
    name2.Replace(wxT("/"), wxT("_"));
    name2.Replace(wxT("\\"), wxT("_"));
    name2.Replace(wxT("*"), wxT("_"));
    name2.Replace(wxT("?"), wxT("_"));

    wxString s = wxFileNameFromPath(m_outputCppFile) + wxT("$") + name2;

    if(wxFileExists(s) && flist.Index(s) == wxNOT_FOUND) {
        for(int i = 0;; i++) {
            s.Printf(wxFileNameFromPath(m_outputCppFile) + wxT("$%03i-") + name2, i);
            if(!wxFileExists(s) || flist.Index(s) != wxNOT_FOUND) break;
        }
    }
    return s;
}
Ejemplo n.º 20
0
void wxSTEPrependArrayString(const wxString &str, wxArrayString &strArray, int count)
{
    const int idx = strArray.Index(str);
    if (idx == 0)
        return;
    if (idx != wxNOT_FOUND)
        strArray.RemoveAt(idx);

    strArray.Insert(str, 0);
    if ((count > 0) && ((int)strArray.GetCount() > count))
        strArray.RemoveAt(count, strArray.GetCount()-count);
}
Ejemplo n.º 21
0
// Option functions (arbitrary name/value mapping)
void wxSystemOptions::SetOption(const wxString& name, const wxString& value)
{
    int idx = gs_optionNames.Index(name, false);
    if (idx == wxNOT_FOUND)
    {
        gs_optionNames.Add(name);
        gs_optionValues.Add(value);
    }
    else
    {
        gs_optionNames[idx] = name;
        gs_optionValues[idx] = value;
    }
}
Ejemplo n.º 22
0
void frmMain::ExpandChildNodes(wxTreeItemId node, wxArrayString &expandedNodes)
{
    wxTreeItemIdValue cookie;
    wxTreeItemId child = browser->GetFirstChild(node, cookie);

    while (child.IsOk())
    {
        if (expandedNodes.Index(GetNodePath(child)) != wxNOT_FOUND)
        {
            browser->Expand(child);
            ExpandChildNodes(child, expandedNodes);
        }

        child = browser->GetNextChild(node, cookie);
    }
}
Ejemplo n.º 23
0
size_t wxMimeTypesManager::EnumAllFileTypes(wxArrayString& mimetypes)
{
    EnsureImpl();
    size_t countAll = m_impl->EnumAllFileTypes(mimetypes);

    // add the fallback filetypes
    size_t count = m_fallbacks.GetCount();
    for ( size_t n = 0; n < count; n++ ) {
        if ( mimetypes.Index(m_fallbacks[n].GetMimeType()) == wxNOT_FOUND ) {
            mimetypes.Add(m_fallbacks[n].GetMimeType());
            countAll++;
        }
    }

    return countAll;
}
Ejemplo n.º 24
0
void ParseThread::GetFileListToParse(const wxString& filename, wxArrayString& arrFiles)
{
	if ( !this->IsCrawlerEnabled() ) {
		return;
	}

	{
		wxCriticalSectionLocker locker( TagsManagerST::Get()->m_crawlerLocker );

		wxArrayString includePaths, excludePaths;
		GetSearchPaths( includePaths, excludePaths );
        
        fcFileOpener::Instance()->ClearResults();
		fcFileOpener::Instance()->ClearSearchPath();
		for(size_t i=0; i<includePaths.GetCount(); i++) {
			fcFileOpener::Instance()->AddSearchPath( includePaths.Item(i).mb_str(wxConvUTF8).data() );
		}

		for(size_t i=0; i<excludePaths.GetCount(); i++) {
			fcFileOpener::Instance()->AddExcludePath(excludePaths.Item(i).mb_str(wxConvUTF8).data());
		}

		// Invoke the crawler
		const wxCharBuffer cfile = filename.mb_str(wxConvUTF8);

		// Skip binary files
		if(TagsManagerST::Get()->IsBinaryFile(filename)) {
			DEBUG_MESSAGE( wxString::Format(wxT("Skipping binary file %s"), filename.c_str()) );
			return;
		}

		// Before using the 'crawlerScan' we lock it, since it is not mt-safe
		crawlerScan( cfile.data() );

	}

	std::set<std::string> fileSet = fcFileOpener::Instance()->GetResults();
	std::set<std::string>::iterator iter = fileSet.begin();
	for (; iter != fileSet.end(); iter++ ) {
		wxFileName fn(wxString((*iter).c_str(), wxConvUTF8));
		fn.MakeAbsolute();
		if ( arrFiles.Index(fn.GetFullPath()) == wxNOT_FOUND ) {
			arrFiles.Add(fn.GetFullPath());
		}
	}
}
Ejemplo n.º 25
0
bool wxExEx::MacroPlayback(const wxString& macro, int repeat)
{
  if (!m_IsActive)
  {
    return false;
  }
  
  const wxArrayString macros(m_Macros.Get());
  
  if (macros.size() == 0)
  {
    return false;
  }
  
  wxString choice(macro);
  
  if (choice.empty())
  {
    wxSingleChoiceDialog dialog(m_STC,
      _("Input") + ":", 
      _("Select Macro"),
      m_Macros.Get());
      
    const int index = macros.Index(m_Macros.GetMacro());
  
    if (index != wxNOT_FOUND)
    {
      dialog.SetSelection(index);
    }

    if (dialog.ShowModal() != wxID_OK)
    {
      return false;
    }
    
    choice = dialog.GetStringSelection();
  }
  
  wxExSTC* stc = m_STC;
  
  const bool ok = m_Macros.Playback(this, choice, repeat);
  
  m_STC = stc;
  
  return ok;
}
Ejemplo n.º 26
0
void PreviewModels::PopulateUnusedModels(wxArrayString ModelsInGroup)
{
    wxString name;
    wxXmlNode* e;
    ListBoxAddToModelGroup->Clear();
    for(e=mModels->GetChildren(); e!=NULL; e=e->GetNext() )
    {
        if (e->GetName() == "model")
        {
            name=e->GetAttribute("name");
            if(ModelsInGroup.Index(name,false,false)==wxNOT_FOUND)
            {
                ListBoxAddToModelGroup->Append(name);
            }
        }
    }
}
Ejemplo n.º 27
0
void ViewsDialog::PopulateUnusedModels(wxArrayString model)
{
    wxString name;
    wxXmlNode* e;
    lstAddModelToViews->Clear();
    for(e=models->GetChildren(); e!=NULL; e=e->GetNext() )
    {
        if (e->GetName() == "model")
        {
            name=e->GetAttribute("name");
            if(model.Index(name,false,false)==wxNOT_FOUND)
            {
                lstAddModelToViews->Append(name);
            }
        }
    }
}
bool FileUtils::WildMatch(const wxArrayString& masks, const wxString& filename)
{
    if(masks.Index("*") != wxNOT_FOUND) {
        // If one of the masks is plain "*" - we match everything
        return true;
    }

    wxString lcFilename = filename.Lower();
    for(size_t i = 0; i < masks.size(); ++i) {
        const wxString& pattern = masks.Item(i);
        if((!pattern.Contains("*") && lcFilename == pattern) ||
            (pattern.Contains("*") && ::wxMatchWild(pattern, lcFilename))) {
            // use exact match
            return true;
        }
    }
    return false;
}
void main_listctrl::refresh_rows_due_column( wxArrayString& channel_sections )
{  
    size_t      number_of_sections           = channel_sections.GetCount();
    wxDateTime  due_datetime;
    wxString    due_string;
    wxString    channel_section;  
    long        row_number = -1;  // '-1' needed to include the first selected row.                                 

    if ( number_of_sections == 0 ) {
        return;
    }     
        
    for ( ;; ) {
        row_number = GetNextItem( row_number, wxLIST_NEXT_ALL );
        
        if ( row_number == -1 ) {
            break; 
        }
        
        channel_section = get_row_channel_section( row_number );
        
        // Only proceed if the current channel section was in our array
        if ( channel_sections.Index( channel_section ) != wxNOT_FOUND ) {
        
            due_datetime   = the_plucker_controller->get_channel_due_datetime( channel_section );    
            due_string     = due_datetime.Format( wxT( plkrPRETTY_COMPACT_DATE_TIME_FORMAT ) ).c_str();        

            if ( ! the_plucker_controller->is_channel_update_enabled( channel_section ) ) {
                due_string = _( "Never" );
            }       
    
            if ( due_string != get_cell_contents_string ( row_number, DUE_COLUMN ) ) {       
                SetItem( row_number, DUE_COLUMN, due_string );
            }        
        }    
    }
}
Ejemplo n.º 30
0
void ProcessingDlg::CheckFilter(
    const wxString& OldBasePath,
    const wxStringStringMap& OldVars,
    const wxArrayString& OldCompilers,
    const LibraryDetectionConfig* Config,
    const LibraryDetectionConfigSet* Set,
    int WhichFilter)
{
    if ( (int)Config->Filters.size() <= WhichFilter )
    {
        FoundLibrary(OldBasePath,OldVars,OldCompilers,Config,Set);
        return;
    }

    const LibraryDetectionFilter& Filter = Config->Filters[WhichFilter];

    switch ( Filter.Type )
    {
        case LibraryDetectionFilter::File:
        {
            // Split path
            wxArrayString Pattern;
            SplitPath(Filter.Value,Pattern);

            // Fetch list of files with filename matching last pattern's element
            const wxArrayString& PathArray = Map[Pattern[Pattern.Count()-1]];
            if ( PathArray.empty() ) return;

            // Process those files
            for ( size_t i=0; i<PathArray.Count(); i++ )
            {
                wxArrayString Path;
                wxStringStringMap Vars = OldVars;
                SplitPath(PathArray[i],Path);

                int path_index = (int)Path.Count() - 1;
                int pattern_index = (int)Pattern.Count() - 1;

                // Check if patterns do match
                while ( ( path_index >= 0 ) && ( pattern_index >= 0 ) )
                {
                    wxString& PatternPart = Pattern[pattern_index];
                    if ( IsVariable(PatternPart) )
                    {
                        wxString VarName = PatternPart.Mid(3,PatternPart.Len()-4);
                        if ( Vars[VarName].empty() )
                        {
                            Vars[VarName] = Path[path_index];
                        }
                        else
                        {
                            if ( Vars[VarName] != Path[path_index] ) break;
                        }
                    }
                    else
                    {
                        if ( PatternPart != Path[path_index] ) break;
                    }
                    path_index--;
                    pattern_index--;
                }

                // This is when patterns did not match
                if ( pattern_index >= 0 ) continue;

                // Construct base path from the rest of file's name
                wxString BasePath;
                for ( int j=0; j<=path_index; j++ )
                {
                    BasePath += Path[j] + wxFileName::GetPathSeparator();
                }

                // And check if base path match the previous one
                if ( !OldBasePath.IsEmpty() )
                {
                    if ( BasePath != OldBasePath ) continue;
                }

                // Ok, this filter matches, let's advance to next filet
                CheckFilter(BasePath,Vars,OldCompilers,Config,Set,WhichFilter+1);
            }
            break;
        }

        case LibraryDetectionFilter::Platform:
        {
            wxStringTokenizer Tokenizer(Filter.Value,_T("| \t"));
            bool IsPlatform = false;
            while ( Tokenizer.HasMoreTokens() )
            {
                wxString Platform = Tokenizer.GetNextToken();

                if ( platform::windows )
                {
                    if ( Platform==_T("win") || Platform==_T("windows") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::macosx )
                {
                    if ( Platform==_T("mac") || Platform==_T("macosx") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::linux )
                {
                    if ( Platform==_T("lin") || Platform==_T("linux") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::freebsd )
                {
                    if ( Platform==_T("bsd") || Platform==_T("freebsd") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::netbsd )
                {
                    if ( Platform==_T("bsd") || Platform==_T("netbsd") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::openbsd )
                {
                    if ( Platform==_T("bsd") || Platform==_T("openbsd") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::darwin )
                {
                    if ( Platform==_T("darwin") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::solaris )
                {
                    if ( Platform==_T("solaris") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }

                if ( platform::unix )
                {
                    if ( Platform==_T("unix") || Platform==_T("un*x") )
                    {
                        IsPlatform = true;
                        break;
                    }
                }
            }

            if ( IsPlatform )
            {
                CheckFilter(OldBasePath,OldVars,OldCompilers,Config,Set,WhichFilter+1);
            }
            break;
        }

        case LibraryDetectionFilter::Exec:
        {
            bool IsExec = false;
            if ( wxIsAbsolutePath(Filter.Value) )
            {
                // If this is absolute path, we don't search in PATH evironment var
                IsExec = wxFileName::IsFileExecutable(Filter.Value);
            }
            else
            {
                // Let's search for the name in search paths
                wxString Path;
                if ( wxGetEnv(_T("PATH"),&Path) )
                {
                    wxString Splitter = _T(":");
                    if ( platform::windows ) Splitter = _T(";");
                    wxStringTokenizer Tokenizer(Path,Splitter);
                    while ( Tokenizer.HasMoreTokens() )
                    {
                        wxString OnePath = Tokenizer.GetNextToken();

                        // Let's skip relative paths (f.ex. ".")
                        if ( !wxIsAbsolutePath(OnePath) ) continue;

                        OnePath += wxFileName::GetPathSeparator()+Filter.Value;
                        if ( wxFileName::IsFileExecutable(OnePath) )
                        {
                            IsExec = true;
                            break;
                        }
                    }
                }
            }

            if ( IsExec )
            {
                CheckFilter(OldBasePath,OldVars,OldCompilers,Config,Set,WhichFilter+1);
            }
            break;
        }

        case LibraryDetectionFilter::PkgConfig:
        {
            if ( m_KnownResults[rtPkgConfig].IsShortCode(Filter.Value) )
            {
                CheckFilter(OldBasePath,OldVars,OldCompilers,Config,Set,WhichFilter+1);
            }
            break;
        }

        case LibraryDetectionFilter::Compiler:
        {
            if ( OldCompilers.IsEmpty() )
            {
                // If this is the first compiler filter, let's build new list and continue
                CheckFilter(OldBasePath,OldVars,wxStringTokenize(Filter.Value,_T("| \t")),Config,Set,WhichFilter+1);
            }
            else
            {
                // We've set compiler list before, leave only the intersection
                // of previous and current list
                wxArrayString Compilers;
                wxStringTokenizer Tokenizer(Filter.Value,_T("| \t"));
                while ( Tokenizer.HasMoreTokens() )
                {
                    wxString Comp = Tokenizer.GetNextToken();
                    if ( OldCompilers.Index(Comp) != wxNOT_FOUND )
                    {
                        Compilers.Add(Comp);
                    }
                }

                if ( !Compilers.IsEmpty() )
                {
                    CheckFilter(OldBasePath,OldVars,Compilers,Config,Set,WhichFilter+1);
                }
            }
            break;
        }

        case LibraryDetectionFilter::None:
        {
            CheckFilter(OldBasePath,OldVars,OldCompilers,Config,Set,WhichFilter+1);
            break;
        }
    }
}