1 #ifndef COLLECTDIRCONTENT_H
2 #define COLLECTDIRCONTENT_H
3 
4 #if defined __cplusplus
5 
6 #include <set>
7 #include <map>
8 #include <string>
9 
10 #if defined( WNT )
11 #include <windows.h>
12 #include <algorithm>
13 #else
14 #include <dirent.h>
15 #endif // defined( WNT )
16 
17 #include <iostream>
18 
19 using namespace std;
20 
21 typedef set<string> DirContent;
22 typedef map<string, DirContent> DirMap;
23 typedef DirMap::value_type EntriesPair;
24 typedef pair<string, string> PathFilePair;
25 
26 
27 struct IncludesCollection {
28     private:
29     DirMap allIncludes;
30 //    bool search(string filePath);
31 //    bool add_dir(string dirPath);
32     PathFilePair split_path(const string& filePath);
33     void add_to_collection(const string& dirPath);
34 
35     public:
36         bool exists(string filePath);
37 };
38 
39 #else
40 
41 struct IncludesCollection;
42 
43 #endif
44 
45 #if defined __cplusplus
46 extern "C" {
47 #endif
48 
49 struct IncludesCollection * create_IncludesCollection(void);
50 void delete_IncludesCollection(struct IncludesCollection *);
51 
52 int call_IncludesCollection_exists(struct IncludesCollection* m, const char* filePath);
53 
54 #if defined __cplusplus
55 }
56 #endif
57 
58 #endif // COLLECTDIRCONTENT_H
59