summaryrefslogtreecommitdiff
path: root/soltools/mkdepend/collectdircontent.hxx
blob: 4980632e2fe352fb37dd8dc17a27a3dd533aaf88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef COLLECTDIRCONTENT_H
#define COLLECTDIRCONTENT_H

#if defined __cplusplus

#include <set>
#include <map>
#include <string>

#if defined( WNT )
#include <windows.h>
#include <algorithm>
#else
#include <dirent.h>
#endif // defined( WNT )

#include <iostream>

typedef std::set<std::string> DirContent;
typedef std::map<std::string, DirContent> DirMap;
typedef DirMap::value_type EntriesPair;
typedef std::pair<std::string, std::string> PathFilePair;


struct IncludesCollection {
    private:
    DirMap allIncludes;
    PathFilePair split_path(const std::string& filePath);
    void add_to_collection(const std::string& dirPath);

    public:
    bool exists(std::string filePath);
};

#else

struct IncludesCollection;

#endif

#if defined __cplusplus
extern "C" {
#endif

struct IncludesCollection * create_IncludesCollection(void);
void delete_IncludesCollection(struct IncludesCollection *);

int call_IncludesCollection_exists(struct IncludesCollection* m, const char* filePath);

#if defined __cplusplus
}
#endif

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */