| 1 | #include <stdio.h> |
| 2 | #include <vector> |
| 3 | |
| 4 | #include "crawler_include.h" |
| 5 | #include <wx/wxcrtvararg.h> |
| 6 | |
| 7 | //#include <windows.h> |
| 8 | |
| 9 | wxString extract_path(const wxString &filePath); |
| 10 | |
| 11 | int main(int argc, char **argv) |
| 12 | { |
| 13 | // fcFileOpener::Get()->AddSearchPath("C:/MinGW-3.4.5/include"); |
| 14 | // fcFileOpener::Get()->AddSearchPath("C:/wxWidgets-2.8.10/include"); |
| 15 | // fcFileOpener::Get()->AddSearchPath("C:\\MinGW-4.4.0\\include"); |
| 16 | // fcFileOpener::Get()->AddSearchPath("C:\\MinGW-4.4.0\\lib\\gcc\\mingw32\\4.4.0\\include\\c++"); |
| 17 | fcFileOpener::Get()->AddSearchPath("D:/wxWidgets-3.0.1/include"); |
| 18 | fcFileOpener::Get()->AddExcludePath("D:/wxWidgets-3.0.1/include/wx/android"); |
| 19 | fcFileOpener::Get()->AddExcludePath("D:/wxWidgets-3.0.1/include/wx/univ"); |
| 20 | fcFileOpener::Get()->AddExcludePath("D:/wxWidgets-3.0.1/include/wx/unix"); |
| 21 | // fcFileOpener::Get()->AddExcludePath("C:\\MinGW-4.4.0\\lib\\gcc\\mingw32\\4.4.0\\include\\c++\\debug"); |
| 22 | // fcFileOpener::Get()->AddExcludePath("C:/wxWidgets-2.8.10/include/wx/unix"); |
| 23 | // fcFileOpener::Get()->AddExcludePath("C:/wxWidgets-2.8.10/include/wx/univ"); |
| 24 | |
| 25 | // fcFileOpener::Get()->AddSearchPath("/usr/include/"); |
| 26 | // fcFileOpener::Get()->AddSearchPath("/usr/include/c++/4.2.4/"); |
| 27 | // fcFileOpener::Get()->AddSearchPath("/usr/include/wx-2.8/"); |
| 28 | |
| 29 | fcFileOpener::Get()->ClearResults(); |
| 30 | for (size_t i=0; i<1; i++) { |
| 31 | // double start = GetTickCount(); |
| 32 | if(crawlerScan("../test.h") < 0) { |
| 33 | printf("failed to scan files\n"); |
| 34 | } |
| 35 | printf("Found %d files \n", fcFileOpener::Get()->GetResults().size()); |
| 36 | |
| 37 | std::set<wxString>::const_iterator iter = fcFileOpener::Get()->GetResults().begin(); |
| 38 | |
| 39 | printf("---->\n"); |
| 40 | for (; iter != fcFileOpener::Get()->GetResults().end(); iter ++) { |
| 41 | wxPrintf("%s\n", (*iter)); |
| 42 | } |
| 43 | |
| 44 | //printf("----> Includes \n"); |
| 45 | //const fcFileOpener::List_t& includeStatements = fcFileOpener::Get()->GetIncludeStatements(); |
| 46 | //fcFileOpener::List_t::const_iterator it = includeStatements.begin(); |
| 47 | //for(; it != includeStatements.end(); ++it) { |
| 48 | // printf("%s\n", (*it).c_str()); |
| 49 | //} |
| 50 | } |
| 51 | |
| 52 | std::set<wxString> ns = fcFileOpener::Get()->GetNamespaces(); |
| 53 | std::set<wxString>::iterator iter = ns.begin(); |
| 54 | for(; iter != ns.end(); iter++) { |
| 55 | wxPrintf("Using namespace: %s\n", iter->c_str()); |
| 56 | } |
| 57 | |
| 58 | std::set<wxString> nsa = fcFileOpener::Get()->GetNamespaceAliases(); |
| 59 | iter = nsa.begin(); |
| 60 | for(; iter != nsa.end(); iter++) { |
| 61 | wxPrintf("Namespace alias: %s\n", iter->c_str()); |
| 62 | } |
| 63 | return 0; |
| 64 | } |