/usr/include/libkomparediff2/kompare.h is in libkomparediff2-dev 4:4.13.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | /***************************************************************************
kompare.h - description
-------------------
begin : Sun Mar 4 2001
Copyright 2001-2003 Otto Bruggeman <otto.bruggeman@home.nl>
Copyright 2001-2003 John Firebaugh <jfirebaugh@kde.org>
****************************************************************************/
/***************************************************************************
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
***************************************************************************/
#ifndef KOMPARE_H
#define KOMPARE_H
#include <kurl.h>
#include "diff2export.h"
// Forward declaration needed
class KTempDir;
namespace Kompare
{
enum Format {
Context = 0,
Ed = 1,
Normal = 2,
RCS = 3,
Unified = 4,
SideBySide = 5,
UnknownFormat = -1
};
enum Generator {
CVSDiff = 0,
Diff = 1,
Perforce = 2,
SubVersion = 3,
Reserved2 = 4,
Reserved3 = 5,
Reserved4 = 6,
Reserved5 = 7,
Reserved6 = 8,
Reserved7 = 9,
UnknownGenerator = -1
};
enum Mode {
ComparingFiles, // compareFiles
ComparingFileString, // Compare a source file with a destination string
ComparingStringFile, // Compare a source string with a destination file
ComparingDirs, // compareDirs
ShowingDiff, // openDiff
BlendingDir, // openDirAndDiff
BlendingFile, // openFileAndDiff
UnknownMode // Used to initialize the Infoi struct
};
enum DiffMode {
Default,
Custom,
UnknownDiffMode // Use to initialize the Info struct
};
enum Status {
RunningDiff,
Parsing,
FinishedParsing,
FinishedWritingDiff,
ReRunningDiff // When a change has been detected after diff has run
};
enum Target {
Source,
Destination
};
struct Info {
Info (
enum Mode _mode = UnknownMode,
enum DiffMode _diffMode = UnknownDiffMode,
enum Format _format = UnknownFormat,
enum Generator _generator = UnknownGenerator,
KUrl _source = KUrl(),
KUrl _destination = KUrl(),
QString _localSource = "",
QString _localDestination = "",
KTempDir* _sourceKTempDir = 0,
KTempDir* _destinationKTempDir = 0,
uint _depth = 0,
bool _applied = true
)
{
mode = _mode;
diffMode = _diffMode;
format = _format;
generator = _generator;
source = _source;
destination = _destination;
localSource = _localSource;
localDestination = _localDestination;
sourceKTempDir = _sourceKTempDir;
destinationKTempDir = _destinationKTempDir;
depth = _depth;
applied = _applied;
}
void swapSourceWithDestination()
{
KUrl url = source;
source = destination;
destination = url;
QString string = localSource;
localSource = localDestination;
localDestination = string;
KTempDir* tmpDir = sourceKTempDir;
sourceKTempDir = destinationKTempDir;
destinationKTempDir = tmpDir;
}
enum Mode mode;
enum DiffMode diffMode;
enum Format format;
enum Generator generator;
KUrl source;
KUrl destination;
QString localSource;
QString localDestination;
KTempDir* sourceKTempDir;
KTempDir* destinationKTempDir;
uint depth;
bool applied;
};
} // End of namespace Kompare
/*
** This should be removed and put somewhere else
*/
class DIFF2_EXPORT KompareFunctions
{
public:
static QString constructRelativePath( const QString& from, const QString& to )
{
KUrl fromURL( from );
KUrl toURL( to );
KUrl root;
int upLevels = 0;
// Find a common root.
root = from;
while( root.isValid() && !root.isParentOf( toURL ) ) {
root = root.upUrl();
upLevels++;
}
if( !root.isValid() ) return to;
QString relative;
for( ; upLevels > 0; upLevels-- ) {
relative += "../";
}
relative += QString( to ).replace( 0, root.path( KUrl::LeaveTrailingSlash ).length(), "" );
return relative;
}
};
#endif
|