Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: b3f5dc2d4cd83ffdd3a533bf498509fb98d75284 (plain) (blame)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*******************************************************************************
 * Copyright (c) 2004, 2010 QNX Software Systems and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     QNX Software Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.make.core.scannerconfig;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.eclipse.cdt.make.internal.core.scannerconfig.util.SymbolEntry;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.w3c.dom.Element;

/**
 * @noextend This class is not intended to be subclassed by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface IDiscoveredPathManager {

	interface IDiscoveredPathInfo {

		IProject getProject();

		/**
		 * Get include paths for the whole project
		 */
		IPath[] getIncludePaths();

		/**
		 * Get defined symbols for the whole project
		 */
		Map<String, String> getSymbols();

		IDiscoveredScannerInfoSerializable getSerializable();
	}

	interface IPerProjectDiscoveredPathInfo extends IDiscoveredPathInfo {
		void setIncludeMap(LinkedHashMap<String, Boolean> map);

		void setSymbolMap(LinkedHashMap<String, SymbolEntry> map);

		LinkedHashMap<String, Boolean> getIncludeMap();

		LinkedHashMap<String, SymbolEntry> getSymbolMap();
	}

	interface IPerFileDiscoveredPathInfo extends IDiscoveredPathInfo {
		/**
		 * Get include paths for the specific path (file)
		 */
		IPath[] getIncludePaths(IPath path);

		/**
		 * Get quote include paths (for #include "...") for the specific path (file)
		 */
		IPath[] getQuoteIncludePaths(IPath path);

		/**
		 * Get defined symbols for the specific path (file)
		 */
		Map<String, String> getSymbols(IPath path);

		/**
		 * Get include files (gcc option -include) for the specific path (file)
		 */
		IPath[] getIncludeFiles(IPath path);

		/**
		 * Get macro files (gcc option -imacros) for the specific path (file)
		 */
		IPath[] getMacroFiles(IPath path);

		/**
		 * Returns if there is any discovered scanner info for the path
		 */
		boolean isEmpty(IPath path);
	}

	interface IPerFileDiscoveredPathInfo2 extends IPerFileDiscoveredPathInfo {
		/**
		 * returns the map containing {@link IResource} - to - {@link PathInfo} pairs representing
		 * complete set of discovered information for the whole project
		 *
		 * @return Map
		 */
		Map<IResource, PathInfo> getPathInfoMap();
	}

	interface IDiscoveredScannerInfoSerializable {
		/**
		 * Serialize discovered scanner info to an XML element
		 */
		public void serialize(Element root);

		/**
		 * Deserialize discovered scanner info from an XML element
		 */
		public void deserialize(Element root);

		/**
		 * @return an id of the collector
		 */
		public String getCollectorId();
	}

	interface IDiscoveredInfoListener {

		void infoChanged(IDiscoveredPathInfo info);

		void infoRemoved(IDiscoveredPathInfo info);
	}

	IDiscoveredPathInfo getDiscoveredInfo(IProject project, InfoContext context) throws CoreException;

	IDiscoveredPathInfo getDiscoveredInfo(IProject project, InfoContext context, boolean defaultToProjectSettings)
			throws CoreException;

	IDiscoveredPathInfo getDiscoveredInfo(IProject project) throws CoreException;

	void removeDiscoveredInfo(IProject project);

	void removeDiscoveredInfo(IProject project, InfoContext context);

	void updateDiscoveredInfo(InfoContext context, IDiscoveredPathInfo info, boolean updateContainer,
			List<IResource> changedResources) throws CoreException;

	void updateDiscoveredInfo(IDiscoveredPathInfo info, List<IResource> changedResources) throws CoreException;

	void changeDiscoveredContainer(IProject project, ScannerConfigScope profileScope, List<IResource> changedResources);

	void addDiscoveredInfoListener(IDiscoveredInfoListener listener);

	void removeDiscoveredInfoListener(IDiscoveredInfoListener listener);
}

Back to the top