Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: baf8f143024bba05e7a8147645ed1641de612c05 (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
/*******************************************************************************
 * Copyright (c) 2013 Red Hat 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:
 *     Red Hat Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.linuxtools.internal.perf;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;

/**
 * Class for handling launch of perf diff command and storing of
 * the resulting data.
 */
public class ReportComparisonData extends AbstractDataManipulator {

    private IPath oldFile;
    private IPath newFile;

    public ReportComparisonData(String title, IPath oldFile, IPath newFile, IProject project) {
        super(title, newFile.removeLastSegments(1), project);
        this.oldFile = oldFile;
        this.newFile = newFile;
    }

    @Override
    public void parse() {
        performCommand(getCommand(), 1);
    }

    /**
     * Get perf diff command to execute.
     *
     * @return String array representing command to execute.
     */
    protected String[] getCommand() {
        return new String[] { PerfPlugin.PERF_COMMAND,
                "diff", //$NON-NLS-1$
                oldFile.toOSString(),
                newFile.toOSString() };
    }

}

Back to the top