blob: db9867c4223248943edbc30d1d392eecf74224f4 (
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
|
/*******************************************************************************
* Copyright (c) 2012 Google, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alex Ruiz - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.codan.core.externaltool;
import org.eclipse.core.resources.IResource;
/**
* Default implementation of <code>{@link InvocationParameters}</code>
*
* @author alruiz@google.com (Alex Ruiz)
*
* @since 2.1
*/
public class InvocationParametersProvider implements IInvocationParametersProvider {
/**
* Creates the parameters to pass when invoking an external tool.
* <p>
* In this implementation:
* <ul>
* <li>the <em>actual</em> file to process is the same as the <em>original</em> file</li>
* <li>the path of the actual file is its absolute path in the file system</li>
* <li>the working directory is {@code null}</li>
* </ul>
* @param fileToProcess the file to process.
* @return the created parameters.
*/
@Override
public InvocationParameters createParameters(IResource fileToProcess) {
String path = fileToProcess.getLocation().toOSString();
return new InvocationParameters(fileToProcess, fileToProcess, path, null);
}
}
|